From 456c23c551cd2dfd7c6bd99c885a777e23ed0fd0 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 17 Oct 2016 16:22:14 +0000 Subject: [PATCH] Customize: Skip triggering initial click on pages section for available nav menu items if already open. Fixes race condition if user opens Pages section before the ajax request to load items finishes. Props ryankienstra, celloexpressions. Fixes #36984. git-svn-id: https://develop.svn.wordpress.org/trunk@38807 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-nav-menus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js index d8ab2eb254..9981cc92ef 100644 --- a/src/wp-admin/js/customize-nav-menus.js +++ b/src/wp-admin/js/customize-nav-menus.js @@ -397,7 +397,7 @@ } self.pages[ type + ':' + object ] = -1; return; - } else if ( 'page' === object ) { + } else if ( ( 'page' === object ) && ( ! availableMenuItemContainer.hasClass( 'open' ) ) ) { availableMenuItemContainer.find( '.accordion-section-title > button' ).click(); } items = new api.Menus.AvailableItemCollection( items ); // @todo Why is this collection created and then thrown away?