Allow the settings view for galleries to be disabled when instantiating `wp.media.controller.GalleryEdit`.

Props nd987.
Fixes #23116.


git-svn-id: https://develop.svn.wordpress.org/trunk@28577 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-05-26 22:48:56 +00:00
parent 92f79f5bcd
commit 5413bfc35a
1 changed files with 19 additions and 13 deletions

View File

@ -785,18 +785,19 @@
*/ */
media.controller.GalleryEdit = media.controller.Library.extend({ media.controller.GalleryEdit = media.controller.Library.extend({
defaults: { defaults: {
id: 'gallery-edit', id: 'gallery-edit',
multiple: false, multiple: false,
describe: true, describe: true,
edge: 199, edge: 199,
editing: false, editing: false,
sortable: true, sortable: true,
searchable: false, searchable: false,
toolbar: 'gallery-edit', toolbar: 'gallery-edit',
content: 'browse', content: 'browse',
title: l10n.editGalleryTitle, title: l10n.editGalleryTitle,
priority: 60, priority: 60,
dragInfo: true, dragInfo: true,
displaySettings: true,
// Don't sync the selection, as the Edit Gallery library // Don't sync the selection, as the Edit Gallery library
// *is* the selection. // *is* the selection.
@ -838,10 +839,15 @@
}, },
gallerySettings: function( browser ) { gallerySettings: function( browser ) {
if ( ! this.get('displaySettings') ) {
return;
}
var library = this.get('library'); var library = this.get('library');
if ( ! library || ! browser ) if ( ! library || ! browser ) {
return; return;
}
library.gallery = library.gallery || new Backbone.Model(); library.gallery = library.gallery || new Backbone.Model();