Widget Customizer: Remove WidgetCustomizer.showFirstSidebarIfRequested().

It's currently unused and needs another iteration.

see #27290.
Built from https://develop.svn.wordpress.org/trunk@27891


git-svn-id: http://core.svn.wordpress.org/trunk@27722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-04-01 12:38:15 +00:00
parent 6528b7804b
commit 404fe8710d
2 changed files with 1 additions and 29 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

File diff suppressed because one or more lines are too long