From 5413bfc35a9dcc773df19343952676c5df5924be Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 26 May 2014 22:48:56 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/media-views.js | 32 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index c732e4a595..edf2db4fb9 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -785,18 +785,19 @@ */ media.controller.GalleryEdit = media.controller.Library.extend({ defaults: { - id: 'gallery-edit', - multiple: false, - describe: true, - edge: 199, - editing: false, - sortable: true, - searchable: false, - toolbar: 'gallery-edit', - content: 'browse', - title: l10n.editGalleryTitle, - priority: 60, - dragInfo: true, + id: 'gallery-edit', + multiple: false, + describe: true, + edge: 199, + editing: false, + sortable: true, + searchable: false, + toolbar: 'gallery-edit', + content: 'browse', + title: l10n.editGalleryTitle, + priority: 60, + dragInfo: true, + displaySettings: true, // Don't sync the selection, as the Edit Gallery library // *is* the selection. @@ -838,10 +839,15 @@ }, gallerySettings: function( browser ) { + if ( ! this.get('displaySettings') ) { + return; + } + var library = this.get('library'); - if ( ! library || ! browser ) + if ( ! library || ! browser ) { return; + } library.gallery = library.gallery || new Backbone.Model();