Changeset 24622
- Timestamp:
- 07/10/2013 03:20:58 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/js/revisions.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/revisions.js
r24615 r24622 260 260 this.listenTo( this, 'update:revisions', this.loadSurrounding ); 261 261 this.listenTo( this, 'change:compareTwoMode', this.changedMode ); 262 this.updateDiff({ immediate: true });263 262 }, 264 263 … … 301 300 // Check if we're actually changing the diff id. 302 301 if ( this._diffId === diffId ) 303 return ;302 return $.Deferred().fail().promise(); 304 303 305 304 this._diffId = diffId; … … 310 309 if ( diff ) { 311 310 this.trigger( 'update:diff', diff ); 312 311 return $.Deferred().resolve().promise(); 313 312 // Otherwise, fetch the diff. 314 313 } else { 315 if ( options.immediate ) 316 this._ensureDiff();317 else314 if ( options.immediate ) { 315 return this._ensureDiff(); 316 } else { 318 317 this._debouncedEnsureDiff(); 318 return $.Deferred().fail().promise(); 319 } 319 320 } 320 321 }, … … 327 328 328 329 _ensureDiff: function() { 329 this.diffs.ensure( this._diffId, this ).done( function( diff ) {330 return this.diffs.ensure( this._diffId, this ).done( function( diff ) { 330 331 // Make sure the current diff didn't change while the request was in flight. 331 332 if ( this._diffId === diff.id ) … … 362 363 363 364 render: function() { 364 wp.Backbone.View.prototype.render.apply( this, arguments ); 365 366 $('#wpbody-content .wrap').append( this.el ); 367 this.views.ready(); 365 this.model.updateDiff({ immediate: true }).done( _.bind( function() { 366 wp.Backbone.View.prototype.render.apply( this, arguments ); 367 368 $('#wpbody-content .wrap').append( this.el ); 369 this.views.ready(); 370 }, this ) ); 368 371 369 372 return this;
Note: See TracChangeset
for help on using the changeset viewer.