changeset 76:f6b51480403e

Fixed model URL bug. Expose `url_edit` for the history view.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 27 Feb 2013 22:02:02 -0800
parents b4599ca2c573
children d5caf4030999
files static/js/wikked/models.js
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/static/js/wikked/models.js	Wed Feb 27 22:02:02 2013 -0800
+++ b/static/js/wikked/models.js	Wed Feb 27 22:02:02 2013 -0800
@@ -133,7 +133,7 @@
             return this;
         },
         url: function() {
-            var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
+            var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || Backbone.urlError();
             if (this.isNew()) return base;
             return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + this.id;
         },
@@ -275,6 +275,8 @@
         _onChangePath: function(path) {
             PageHistoryModel.__super__._onChangePath.apply(this, arguments);
             this.set({
+                url_read: '/#/read/' + path,
+                url_edit: '/#/edit/' + path,
                 url_rev: '/#/revision/' + path,
                 url_diffc: '/#/diff/c/' + path,
                 url_diffr: '/#/diff/r/' + path