From b5a54ae692fc06c873bf02bae072c9989f52f1e3 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 12 Feb 2016 23:51:16 +0000 Subject: [PATCH] Customize: Hide widgets re-order button when no re-ordering is possible. Hide the re-order button if there are no widgets in the sidebar, or if there is there is only one sidebar and there is only one widget in the sidebar. Props rabmalin, westonruter. Fixes #35533. git-svn-id: https://develop.svn.wordpress.org/trunk@36522 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/js/customize-widgets.js b/src/wp-admin/js/customize-widgets.js index 5ec3185b96..6237c1250d 100644 --- a/src/wp-admin/js/customize-widgets.js +++ b/src/wp-admin/js/customize-widgets.js @@ -1829,7 +1829,7 @@ } }); - if ( ! widgetControls.length ) { + if ( 0 === widgetControls.length || ( 1 === api.Widgets.registeredSidebars.length && widgetControls.length <= 1 ) ) { this.container.find( '.reorder-toggle' ).hide(); return; } else {