Make WordPress Core

Changeset 24600


Ignore:
Timestamp:
07/09/2013 07:07:53 AM (13 years ago)
Author:
koopersmith
Message:

Revisions: Remove redundant method, see #24425.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/revisions.js

    r24595 r24600  
    200200                initialize: function( attributes, options ) {
    201201                        this.revisions = options.revisions;
    202                         this.diffs     = new revisions.model.Diffs( [], {revisions: this.revisions} );
    203                         this.listenTo( this, 'change:from', this.updateDiffFrom );
    204                         this.listenTo( this, 'change:to', this.updateDiffTo );
     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 );
    205205                        this.revisionsRouter = new revisions.router.Router({ model: this });
    206206                },
    207207
    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');
    210213                        this.set( 'diffId', (from ? from.id : '0' ) + ':' + this.get('to').id );
    211                 },
    212 
    213                 updateDiffFrom: function() {
    214                         if ( this.get( 'compareTwoMode' ) )
    215                                 this.updateDiffTo();
    216214                }
    217215        });
Note: See TracChangeset for help on using the changeset viewer.