From 2d6c10b842de0fc371df4e7c0641e8912afc466a Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Sat, 8 Aug 2015 09:36:55 +0000 Subject: [PATCH] Customizer: Restore Shift + Clicking on widgets to open the widgets panel. Includes an alternative for jQuery UI's `:focusable` selector because it has an ancestor visibility requirement, see https://github.com/jquery/jquery-ui/pull/1583. props westonruter. fixes #33258. git-svn-id: https://develop.svn.wordpress.org/trunk@33596 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 5 +++-- src/wp-admin/js/customize-widgets.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 739b96233b..56a9e62d2c 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -73,8 +73,9 @@ } else { focusContainer = construct.container; } - focusContainer.find( ':focusable:first' ).focus(); - focusContainer[0].scrollIntoView( true ); + + // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583 + focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first().focus(); }; if ( params.completeCallback ) { completeCallback = params.completeCallback; diff --git a/src/wp-admin/js/customize-widgets.js b/src/wp-admin/js/customize-widgets.js index 8aa603a76d..f1490a5638 100644 --- a/src/wp-admin/js/customize-widgets.js +++ b/src/wp-admin/js/customize-widgets.js @@ -1270,7 +1270,7 @@ if ( expanded ) { - if ( 'undefined' != typeof api.section( self.section ) && ! api.section( self.section ).expanded() ) { + if ( self.section() && api.section( self.section() ) ) { self.expandControlSection(); }