Changeset 29066
- Timestamp:
- 07/10/2014 04:01:49 PM (11 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29057 r29066 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', … … 30 30 }, 31 31 32 initialize: function() { 33 media.controller._State.prototype.initialize.apply( this, arguments ); 34 }, 35 32 _ready: function() {}, 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 },40 41 deactivate: function() {42 this.stopListening( this.frame );43 41 }, 44 42 -
trunk/src/wp-includes/js/media-views.js
r29065 r29066 338 338 339 339 /** 340 * A more abstracted state, because media.controller.State expects341 * specific regions (menu, title, etc.) to exist on the frame, which do not342 * exist in media.view.Frame.EditAttachment.343 */344 media.controller._State = Backbone.Model.extend({345 constructor: function() {346 this.on( 'activate', this._preActivate, this );347 this.on( 'activate', this.activate, this );348 this.on( 'activate', this._postActivate, this );349 this.on( 'deactivate', this._deactivate, this );350 this.on( 'deactivate', this.deactivate, this );351 this.on( 'reset', this.reset, this );352 this.on( 'ready', this.ready, this );353 /**354 * Call parent constructor with passed arguments355 */356 Backbone.Model.apply( this, arguments );357 },358 359 /**360 * @abstract361 */362 ready: function() {},363 /**364 * @abstract365 */366 activate: function() {},367 /**368 * @abstract369 */370 deactivate: function() {},371 /**372 * @abstract373 */374 reset: function() {},375 /**376 * @access private377 */378 _preActivate: function() {379 this.active = true;380 },381 /**382 * @access private383 */384 _postActivate: function() {},385 /**386 * @access private387 */388 _deactivate: function() {389 this.active = false;390 }391 });392 393 /**394 340 * wp.media.controller.State 395 341 * … … 401 347 * @augments Backbone.Model 402 348 */ 403 media.controller.State = media.controller._State.extend({349 media.controller.State = Backbone.Model.extend({ 404 350 constructor: function() { 405 351 this.on( 'activate', this._preActivate, this ); … … 417 363 this.on( 'change:menu', this._updateMenu, this ); 418 364 }, 419 365 /** 366 * @abstract 367 */ 368 ready: function() {}, 369 /** 370 * @abstract 371 */ 372 activate: function() {}, 373 /** 374 * @abstract 375 */ 376 deactivate: function() {}, 377 /** 378 * @abstract 379 */ 380 reset: function() {}, 420 381 /** 421 382 * @access private … … 424 385 this._updateMenu(); 425 386 }, 426 387 /** 388 * @access private 389 */ 390 _preActivate: function() { 391 this.active = true; 392 }, 427 393 /** 428 394 * @access private
Note: See TracChangeset
for help on using the changeset viewer.