Make WordPress Core

Changeset 27891


Ignore:
Timestamp:
04/01/2014 12:37:43 PM (13 years ago)
Author:
ocean90
Message:

Widget Customizer: Remove WidgetCustomizer.showFirstSidebarIfRequested().

It's currently unused and needs another iteration.

see #27290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-widgets.js

    r27890 r27891  
    140140         */
    141141        self.init = function () {
    142                 this.showFirstSidebarIfRequested();
    143142                this.availableWidgetsPanel.setup();
    144143        };
    … …  
    146145                self.init();
    147146        } );
    148 
    149         /**
    150          * Listen for updates to which sidebars are rendered in the preview and toggle
    151          * the customizer sections accordingly.
    152          */
    153         self.showFirstSidebarIfRequested = function () {
    154                 if ( ! /widget-customizer=open/.test( location.search ) ) {
    155                         return;
    156                 }
    157 
    158                 var show_first_visible_sidebar = function () {
    159                         self.registered_sidebars.off( 'change:is_rendered', show_first_visible_sidebar );
    160                         var section, first_rendered_sidebar = self.registered_sidebars.find( function ( sidebar ) {
    161                                 return sidebar.get( 'is_rendered' );
    162                         } );
    163                         if ( ! first_rendered_sidebar ) {
    164                                 return;
    165                         }
    166                         section = $( '#accordion-section-sidebar-widgets-' + first_rendered_sidebar.get( 'id' ) );
    167                         if ( ! section.hasClass( 'open' ) ) {
    168                                 section.find( '.accordion-section-title' ).trigger( 'click' );
    169                         }
    170                         section[0].scrollIntoView();
    171                 };
    172                 show_first_visible_sidebar = _.debounce( show_first_visible_sidebar, 100 ); // so only fires when all updated at end
    173                 self.registered_sidebars.on( 'change:is_rendered', show_first_visible_sidebar );
    174         };
    175147
    176148        /**
Note: See TracChangeset for help on using the changeset viewer.