Revisions: Remove redundant method, see #24425.
git-svn-id: https://develop.svn.wordpress.org/trunk@24600 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8f24ab263d
commit
7f8538805b
|
@ -200,19 +200,17 @@ window.wp = window.wp || {};
|
|||
initialize: function( attributes, options ) {
|
||||
this.revisions = options.revisions;
|
||||
this.diffs = new revisions.model.Diffs( [], { revisions: this.revisions });
|
||||
this.listenTo( this, 'change:from', this.updateDiffFrom );
|
||||
this.listenTo( this, 'change:to', this.updateDiffTo );
|
||||
this.listenTo( this, 'change:from', this.updateDiff );
|
||||
this.listenTo( this, 'change:to', this.updateDiff );
|
||||
this.revisionsRouter = new revisions.router.Router({ model: this });
|
||||
},
|
||||
|
||||
updateDiffTo: function() {
|
||||
// So long as `from` and `to` are changed at the same time, the diff
|
||||
// will only be updated once. This is because Backbone updates all of
|
||||
// the changed attributes in `set`, and then fires the `change` events.
|
||||
updateDiff: function() {
|
||||
var from = this.get('from');
|
||||
this.set( 'diffId', (from ? from.id : '0' ) + ':' + this.get('to').id );
|
||||
},
|
||||
|
||||
updateDiffFrom: function() {
|
||||
if ( this.get( 'compareTwoMode' ) )
|
||||
this.updateDiffTo();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue