From b74982a47955a89a89aa1d3830f828b39581b54b Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 8 Apr 2015 17:52:18 +0000 Subject: [PATCH] Customizer Theme Switcher: Don't deactivate section on empty search results. props westonruter. fixes #31889. git-svn-id: https://develop.svn.wordpress.org/trunk@32083 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 4f04de4c0f..f8a64dc2dd 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -584,6 +584,21 @@ }); }, + /** + * Override Section.isContextuallyActive method. + * + * Ignore the active states' of the contained theme controls, and just + * use the section's own active state instead. This ensures empty search + * results for themes to cause the section to become inactive. + * + * @since 4.2.0 + * + * @returns {Boolean} + */ + isContextuallyActive: function () { + return this.active(); + }, + /** * @since 4.2.0 */