From 57a7ed15a76f101a695b60fbafe2ec529d056819 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 31 Aug 2015 23:07:57 +0000 Subject: [PATCH] Customizer: Collapse any expanded panel/sections before expanding other panel/sections Fix removes need for workaround introduced in [33488] for direct link from nav menu widget to the customizer widgets panel. The todo is now implemented. Props celloexpressions, westonruter. Fixes #33396 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@33837 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 5 ++++- src/wp-includes/default-widgets.php | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 84f7faf739..b3b44333b2 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -655,6 +655,9 @@ completeCallback: expand }); } else { + api.panel.each( function( panel ) { + panel.collapse(); + }); expand(); } @@ -1264,7 +1267,7 @@ // Collapse any sibling sections/panels api.section.each( function ( section ) { - if ( ! section.panel() ) { + if ( panel.id !== section.panel() ) { section.collapse( { duration: 0 } ); } }); diff --git a/src/wp-includes/default-widgets.php b/src/wp-includes/default-widgets.php index 0478caf79c..feb73aa41b 100644 --- a/src/wp-includes/default-widgets.php +++ b/src/wp-includes/default-widgets.php @@ -1570,8 +1570,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {