WordPress.org

Make WordPress Core

Changeset 33837


Ignore:
Timestamp:
08/31/2015 11:07:57 PM (4 years ago)
Author:
westonruter
Message:

Customizer: Collapse any expanded panel/sections before expanding other panel/sections

Fix removes need for workaround introduced in [33488] for direct link from nav menu widget to the customizer widgets panel. The todo is now implemented.

Props celloexpressions, westonruter.
Fixes #33396 for trunk.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r33754 r33837  
    656656                    });
    657657                } else {
     658                    api.panel.each( function( panel ) {
     659                        panel.collapse();
     660                    });
    658661                    expand();
    659662                }
     
    12651268                // Collapse any sibling sections/panels
    12661269                api.section.each( function ( section ) {
    1267                     if ( ! section.panel() ) {
     1270                    if ( panel.id !== section.panel() ) {
    12681271                        section.collapse( { duration: 0 } );
    12691272                    }
  • trunk/src/wp-includes/default-widgets.php

    r33824 r33837  
    15711571            <?php
    15721572            if ( isset( $GLOBALS['wp_customize'] ) && $GLOBALS['wp_customize'] instanceof WP_Customize_Manager ) {
    1573                 // @todo When expanding a panel, the JS should be smart enough to collapse any existing panels and sections.
    1574                 $url = 'javascript: wp.customize.section.each(function( section ){ section.collapse(); }); wp.customize.panel( "nav_menus" ).focus();';
     1573                $url = 'javascript: wp.customize.panel( "nav_menus" ).focus();';
    15751574            } else {
    15761575                $url = admin_url( 'nav-menus.php' );
Note: See TracChangeset for help on using the changeset viewer.