WordPress.org

Make WordPress Core

Changeset 33942


Ignore:
Timestamp:
09/07/2015 06:19:35 AM (6 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.

Cherry-picks [33837] onto 4.3 branch.
Props celloexpressions, westonruter.
Fixes #33396 for 4.3.

Location:
branches/4.3/src
Files:
2 edited

Legend:

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

    r33941 r33942  
    658658                    });
    659659                } else {
     660                    api.panel.each( function( panel ) {
     661                        panel.collapse();
     662                    });
    660663                    expand();
    661664                }
     
    12671270                // Collapse any sibling sections/panels
    12681271                api.section.each( function ( section ) {
    1269                     if ( ! section.panel() ) {
     1272                    if ( panel.id !== section.panel() ) {
    12701273                        section.collapse( { duration: 0 } );
    12711274                    }
  • branches/4.3/src/wp-includes/default-widgets.php

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