Changeset 24600
- Timestamp:
- 07/09/2013 07:07:53 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/revisions.js
r24595 r24600 200 200 initialize: function( attributes, options ) { 201 201 this.revisions = options.revisions; 202 this.diffs = new revisions.model.Diffs( [], {revisions: this.revisions});203 this.listenTo( this, 'change:from', this.updateDiff From);204 this.listenTo( this, 'change:to', this.updateDiff To);202 this.diffs = new revisions.model.Diffs( [], { revisions: this.revisions }); 203 this.listenTo( this, 'change:from', this.updateDiff ); 204 this.listenTo( this, 'change:to', this.updateDiff ); 205 205 this.revisionsRouter = new revisions.router.Router({ model: this }); 206 206 }, 207 207 208 updateDiffTo: function() { 209 var from = this.get( 'from' ); 208 // So long as `from` and `to` are changed at the same time, the diff 209 // will only be updated once. This is because Backbone updates all of 210 // the changed attributes in `set`, and then fires the `change` events. 211 updateDiff: function() { 212 var from = this.get('from'); 210 213 this.set( 'diffId', (from ? from.id : '0' ) + ':' + this.get('to').id ); 211 },212 213 updateDiffFrom: function() {214 if ( this.get( 'compareTwoMode' ) )215 this.updateDiffTo();216 214 } 217 215 });
Note: See TracChangeset
for help on using the changeset viewer.