From bb7c7e06c0df9119852a731fa114b54f49bcd0e3 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 1 Apr 2014 12:37:43 +0000 Subject: [PATCH] Widget Customizer: Remove WidgetCustomizer.showFirstSidebarIfRequested(). It's currently unused and needs another iteration. see #27290. git-svn-id: https://develop.svn.wordpress.org/trunk@27891 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-widgets.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/wp-admin/js/customize-widgets.js b/src/wp-admin/js/customize-widgets.js index 7859a6120a..86659dfdf2 100644 --- a/src/wp-admin/js/customize-widgets.js +++ b/src/wp-admin/js/customize-widgets.js @@ -139,40 +139,12 @@ var WidgetCustomizer = ( function ($) { * customizer controls. */ self.init = function () { - this.showFirstSidebarIfRequested(); this.availableWidgetsPanel.setup(); }; wp.customize.bind( 'ready', function () { self.init(); } ); - /** - * Listen for updates to which sidebars are rendered in the preview and toggle - * the customizer sections accordingly. - */ - self.showFirstSidebarIfRequested = function () { - if ( ! /widget-customizer=open/.test( location.search ) ) { - return; - } - - var show_first_visible_sidebar = function () { - self.registered_sidebars.off( 'change:is_rendered', show_first_visible_sidebar ); - var section, first_rendered_sidebar = self.registered_sidebars.find( function ( sidebar ) { - return sidebar.get( 'is_rendered' ); - } ); - if ( ! first_rendered_sidebar ) { - return; - } - section = $( '#accordion-section-sidebar-widgets-' + first_rendered_sidebar.get( 'id' ) ); - if ( ! section.hasClass( 'open' ) ) { - section.find( '.accordion-section-title' ).trigger( 'click' ); - } - section[0].scrollIntoView(); - }; - show_first_visible_sidebar = _.debounce( show_first_visible_sidebar, 100 ); // so only fires when all updated at end - self.registered_sidebars.on( 'change:is_rendered', show_first_visible_sidebar ); - }; - /** * Sidebar Widgets control * Note that 'sidebar_widgets' must match the Sidebar_Widgets_WP_Customize_Control::$type