Changeset 27273
- Timestamp:
- 02/25/2014 08:06:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/revisions.js
r27114 r27273 1049 1049 }); 1050 1050 1051 // The revisions router 1052 // takes URLs with #hash fragments and routes them1051 // The revisions router. 1052 // Maintains the URL routes so browser URL matches state. 1053 1053 revisions.Router = Backbone.Router.extend({ 1054 1054 initialize: function( options ) { 1055 1055 this.model = options.model; 1056 this.routes = _.object([ 1057 [ this.baseUrl( '?from=:from&to=:to' ), 'handleRoute' ], 1058 [ this.baseUrl( '?from=:from&to=:to' ), 'handleRoute' ] 1059 ]); 1056 1060 1057 // Maintain state and history when navigating 1061 1058 this.listenTo( this.model, 'update:diff', _.debounce( this.updateUrl, 250 ) ); … … 1086 1083 a = a ? a.id : 0; 1087 1084 } 1088 1089 this.model.set({1090 from: this.model.revisions.get( parseInt( a, 10 ) ),1091 to: this.model.revisions.get( parseInt( a, 10 ) ),1092 compareTwoMode: compareTwo1093 });1094 1085 } 1095 1086 });
Note: See TracChangeset
for help on using the changeset viewer.