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:
parent
452c486d5f
commit
4aa6a83d47
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue