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

git-svn-id: https://develop.svn.wordpress.org/trunk@22792 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-21 20:43:42 +00:00
parent e99789f504
commit 95ed1b1a45
1 changed files with 8 additions and 8 deletions

View File

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