Ticket #26565: 26565.diff
File 26565.diff, 1.1 KB (added by , 11 years ago) |
---|
-
src/wp-admin/js/revisions.js
1048 1048 } 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 ) ); 1062 1059 this.listenTo( this.model, 'change:compareTwoMode', this.updateUrl ); … … 1085 1082 b = b ? b.id : 0; 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 }); 1096 1087