Changeset 24606
- Timestamp:
- 07/09/2013 08:14:38 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/revisions.js
r24605 r24606 413 413 414 414 // Update route 415 this.model.revisionsRouter. navigateRoute( this.model.get('to').id, this.model.get('from').id);415 this.model.revisionsRouter.updateUrl(); 416 416 }, 417 417 … … 499 499 500 500 // Update route 501 this.model.revisionsRouter. navigateRoute( attributes.to.id, attributes.from ? attributes.from.id : 0);501 this.model.revisionsRouter.updateUrl(); 502 502 }, 503 503 … … 797 797 798 798 // Maintain state history when dragging 799 this.listenTo( this.model, 'renderDiff', this.updateURL);799 this.listenTo( this.model, 'renderDiff', _.debounce( this.updateUrl, 250 ) ); 800 800 }, 801 801 … … 804 804 }, 805 805 806 navigateRoute: function( to, from ) { 807 var navigateTo = '/revision/from/' + from + '/to/' + to + '/handles/'; 808 if ( this.model.get('compareTwoMode') ) { 809 navigateTo += '2'; 810 } else { 811 navigateTo += '1'; 812 } 813 this.navigate( navigateTo ); 814 }, 815 816 updateURL: _.debounce( function() { 817 var from = this.model.get('from'); 818 this.navigateRoute( this.model.get('to').id, from ? from.id : 0 ); 819 }, 250 ), 806 updateUrl: function() { 807 var from = this.model.has('from') ? this.model.get('from').id : 0; 808 var to = this.model.get('to').id; 809 var handles = this.model.get('compareTwoMode') ? '2' : '1'; 810 811 this.navigate( '/revision/from/' + from + '/to/' + to + '/handles/' + handles ); 812 }, 820 813 821 814 gotoRevisionId: function( from, to, handles ) {
Note: See TracChangeset
for help on using the changeset viewer.