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
This commit is contained in:
Weston Ruter 2016-10-17 16:22:14 +00:00
parent 246aa65a19
commit 456c23c551
1 changed files with 1 additions and 1 deletions

View File

@ -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?