Ticket #24716: 24716.42.diff
File 24716.42.diff, 3.8 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/media-grid.js
diff --git a/src/wp-includes/js/media-grid.js b/src/wp-includes/js/media-grid.js index b0541a6..5798b6a 100644
a b 17 17 * @augments wp.media.controller.State 18 18 * @augments Backbone.Model 19 19 */ 20 media.controller.EditImageNoFrame = media.controller. _State.extend({20 media.controller.EditImageNoFrame = media.controller.State.extend({ 21 21 defaults: { 22 22 id: 'edit-attachment', 23 23 title: l10n.editImage, … … 29 29 url: '' 30 30 }, 31 31 32 initialize: function() { 33 media.controller._State.prototype.initialize.apply( this, arguments ); 34 }, 32 _ready: function() {}, 35 33 34 /** 35 * Override media.controller.State._postActivate, since this state doesn't 36 * include the regions expected there. 37 */ 36 38 _postActivate: function() { 37 39 this._content(); 38 40 this._router(); 39 41 }, 40 42 41 deactivate: function() {42 this.stopListening( this.frame );43 },44 45 43 /** 46 44 * @access private 47 45 */ -
src/wp-includes/js/media-views.js
diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index 328f59a..b199c1b 100644
a b 337 337 }); 338 338 339 339 /** 340 * A more abstracted state, because media.controller.State expects 341 * specific regions (menu, title, etc.) to exist on the frame, which do not 342 * exist in media.view.Frame.EditAttachment. 340 * wp.media.controller.State 341 * 342 * A state is a step in a workflow that when set will trigger the controllers 343 * for the regions to be updated as specified in the frame. This is the base 344 * class that the various states used in wp.media extend. 345 * 346 * @constructor 347 * @augments Backbone.Model 343 348 */ 344 media.controller. _State = Backbone.Model.extend({349 media.controller.State = Backbone.Model.extend({ 345 350 constructor: function() { 346 351 this.on( 'activate', this._preActivate, this ); 347 352 this.on( 'activate', this.activate, this ); … … 349 354 this.on( 'deactivate', this._deactivate, this ); 350 355 this.on( 'deactivate', this.deactivate, this ); 351 356 this.on( 'reset', this.reset, this ); 357 this.on( 'ready', this._ready, this ); 352 358 this.on( 'ready', this.ready, this ); 353 359 /** 354 360 * Call parent constructor with passed arguments 355 361 */ 356 362 Backbone.Model.apply( this, arguments ); 363 this.on( 'change:menu', this._updateMenu, this ); 357 364 }, 358 359 365 /** 360 366 * @abstract 361 367 */ … … 375 381 /** 376 382 * @access private 377 383 */ 378 _preActivate: function() { 379 this.active = true; 380 }, 381 /** 382 * @access private 383 */ 384 _postActivate: function() {}, 385 /** 386 * @access private 387 */ 388 _deactivate: function() { 389 this.active = false; 390 } 391 }); 392 393 /** 394 * wp.media.controller.State 395 * 396 * A state is a step in a workflow that when set will trigger the controllers 397 * for the regions to be updated as specified in the frame. This is the base 398 * class that the various states used in wp.media extend. 399 * 400 * @constructor 401 * @augments Backbone.Model 402 */ 403 media.controller.State = media.controller._State.extend({ 404 constructor: function() { 405 this.on( 'activate', this._preActivate, this ); 406 this.on( 'activate', this.activate, this ); 407 this.on( 'activate', this._postActivate, this ); 408 this.on( 'deactivate', this._deactivate, this ); 409 this.on( 'deactivate', this.deactivate, this ); 410 this.on( 'reset', this.reset, this ); 411 this.on( 'ready', this._ready, this ); 412 this.on( 'ready', this.ready, this ); 413 /** 414 * Call parent constructor with passed arguments 415 */ 416 Backbone.Model.apply( this, arguments ); 417 this.on( 'change:menu', this._updateMenu, this ); 384 _ready: function() { 385 this._updateMenu(); 418 386 }, 419 420 387 /** 421 388 * @access private 422 423 _ ready: function() {424 this. _updateMenu();389 */ 390 _preActivate: function() { 391 this.active = true; 425 392 }, 426 427 393 /** 428 394 * @access private 429 395 */