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
This commit is contained in:
Dominik Schilling (ocean90) 2014-04-01 12:37:43 +00:00
parent ab5b649243
commit bb7c7e06c0
1 changed files with 0 additions and 28 deletions

View File

@ -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