From 395c8b7cd4009d8380a1048664478158f2611522 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 7 Sep 2015 05:58:44 +0000 Subject: [PATCH] Customize: Fix logic for determining the container element when focusing on a panel, section, or control. Fixes #33695 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@33939 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 1d1abd8b7c..3e4005d45c 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -82,8 +82,10 @@ params = params || {}; focus = function () { var focusContainer; - if ( construct.expanded && construct.expanded() ) { - focusContainer = construct.container.find( 'ul:first' ); + if ( construct.extended( api.Panel ) && construct.expanded && construct.expanded() ) { + focusContainer = construct.container.find( 'ul.control-panel-content' ); + } else if ( construct.extended( api.Section ) && construct.expanded && construct.expanded() ) { + focusContainer = construct.container.find( 'ul.accordion-section-content' ); } else { focusContainer = construct.container; }