Media: Rename PriorityList's add/remove methods to set/unset (to prevent the default remove from being overridden). see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-21 20:43:42 +00:00
parent 452c486d5f
commit 4aa6a83d47
1 changed files with 8 additions and 8 deletions

View File

@ -1116,7 +1116,7 @@
}; };
}, this ); }, this );
this.menu.view().add( views ); this.menu.view().set( views );
}, },
hijackThickbox: function() { hijackThickbox: function() {
@ -1439,7 +1439,7 @@
mainMenu: function() { mainMenu: function() {
media.view.MediaFrame.Select.prototype.mainMenu.call( this, { silent: true }); media.view.MediaFrame.Select.prototype.mainMenu.call( this, { silent: true });
this.menu.view().add({ this.menu.view().set({
separateLibrary: new media.View({ separateLibrary: new media.View({
className: 'separator', className: 'separator',
priority: 60 priority: 60
@ -1538,7 +1538,7 @@
library.gallery = library.gallery || new Backbone.Model(); library.gallery = library.gallery || new Backbone.Model();
this.sidebar.view().add({ this.sidebar.view().set({
gallery: new media.view.Settings.Gallery({ gallery: new media.view.Settings.Gallery({
controller: this, controller: this,
model: library.gallery, model: library.gallery,
@ -1560,7 +1560,7 @@
link: getUserSetting( 'urlbutton', 'post' ) link: getUserSetting( 'urlbutton', 'post' )
}); });
this.sidebar.view().add({ this.sidebar.view().set({
display: new media.view.Settings.AttachmentDisplay({ display: new media.view.Settings.AttachmentDisplay({
controller: this, controller: this,
model: display[ single.cid ], model: display[ single.cid ],
@ -2181,7 +2181,7 @@
this.controller = this.options.controller; this.controller = this.options.controller;
this._views = {}; this._views = {};
this.add( _.extend( {}, this._views, this.options.views ), { silent: true }); this.set( _.extend( {}, this._views, this.options.views ), { silent: true });
delete this.options.views; delete this.options.views;
if ( ! this.options.silent ) if ( ! this.options.silent )
@ -2209,13 +2209,13 @@
return this; return this;
}, },
add: function( id, view, options ) { set: function( id, view, options ) {
options = options || {}; options = options || {};
// Accept an object with an `id` : `view` mapping. // Accept an object with an `id` : `view` mapping.
if ( _.isObject( id ) ) { if ( _.isObject( id ) ) {
_.each( id, function( view, id ) { _.each( id, function( view, id ) {
this.add( id, view, { silent: true }); this.set( id, view, { silent: true });
}, this ); }, this );
if ( ! options.silent ) if ( ! options.silent )
@ -2238,7 +2238,7 @@
return this._views[ id ]; return this._views[ id ];
}, },
remove: function( id, options ) { unset: function( id, options ) {
delete this._views[ id ]; delete this._views[ id ];
if ( ! options || ! options.silent ) if ( ! options || ! options.silent )
this.render(); this.render();