WordPress.org

Make WordPress Core

Changeset 39548


Ignore:
Timestamp:
12/09/2016 06:15:15 AM (18 months ago)
Author:
westonruter
Message:

Customize: Collapse available nav menu items panel when clicking outside over preview or over existing items.

Props rockwell15.
Fixes #38953.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/customize-nav-menus.css

    r39378 r39548  
    720720}
    721721
     722body.adding-menu-items #customize-preview iframe {
     723    pointer-events: none;
     724}
     725
    722726.menu-item-handle .spinner {
    723727    display: none;
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r39502 r39548  
    666666        // Opens the panel.
    667667        open: function( menuControl ) {
     668            var panel = this, close;
     669
    668670            this.currentMenuControl = menuControl;
    669671
     
    671673
    672674            $( 'body' ).addClass( 'adding-menu-items' );
     675
     676            close = function() {
     677                panel.close();
     678                $( this ).off( 'click', close );
     679            };
     680            $( '#customize-preview' ).on( 'click', close );
    673681
    674682            // Collapse all controls.
     
    13201328                e.preventDefault();
    13211329                e.stopPropagation();
     1330                api.Menus.availableMenuItemsPanel.close();
    13221331                var menuControl = control.getMenuControl();
    13231332                if ( menuControl.isReordering || menuControl.isSorting ) {
Note: See TracChangeset for help on using the changeset viewer.