[wp-trac] [WordPress Trac] #33052: Widgets section in customize late to show up

WordPress Trac noreply at wordpress.org
Fri Sep 25 04:52:11 UTC 2015


#33052: Widgets section in customize late to show up
-------------------------------------------------+-------------------------
 Reporter:  kidsguide                            |       Owner:
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.4
Component:  Customize                            |     Version:  3.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  javascript
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * keywords:  needs-patch => has-patch needs-testing needs-unit-tests


Comment:

 See [attachment:33052.diff].

 Video demo: https://cloudup.com/cHEat_4UK91

 Widgets panel will now show initially even if no widget areas are rendered
 in the preview. It will be hidden and remain hidden if no sidebars are
 registered.

 If opening the widgets panel and there are no sidebars currently rendered
 in the preview, then a notice is displayed with instructions for how to
 access the desired sidebar for management (via navigating in the preview
 window).

 If a widget area section is expanded, then when navigating in the preview
 to a URL that does not have a `dynamic_sidebar()` call, then the widget
 area section will be collapsed and the user will be bumped up to the
 widgets panel instead of the root of the Customizer.

 This patch also fixes autofocusing on panels that are inactive, making
 `focus` (and `expand`) a no-op if the element (or its container) is not
 active. This fixes a bug where the Customizer panel can empty itself
 without a way for the user to go back. That bug can be demonstrated by
 running the following in the JS console:

 {{{#!js
 wp.customize.section('colors').deactivate({ completeCallback: function(){
     wp.customize.control('background_color').focus();
 }})
 }}}

 This PR also fixes an issue where an additional `pane-contents-reflowed`
 event handler to each time a section or panel would be expanded. It also
 fixes an incorrect top-margin that would result when a panel's sections
 would toggle their `active` state; now it will re-calculate the `margin-
 top` at the time of expansion as well.

 @afercia Does the `no-widget-areas-rendered-notice` need some aria love?

 The way I set up my test here was just to make this change to
 twentyfifteen to cause the widget area to not appear on the homepage:

 {{{#!diff
 --- src/wp-content/themes/twentyfifteen/sidebar.php
 +++ src/wp-content/themes/twentyfifteen/sidebar.php
 @@ -36,7 +36,7 @@ if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social'
 ) || is_active_sidebar(
                         </nav><!-- .social-navigation -->
                 <?php endif; ?>

 -               <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
 +               <?php if ( ! is_front_page() ) : ?>
                         <div id="widget-area" class="widget-area"
 role="complementary">
                                 <?php dynamic_sidebar( 'sidebar-1' ); ?>
                         </div><!-- .widget-area -->
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33052#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list