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.

Built from https://develop.svn.wordpress.org/trunk@38807


git-svn-id: http://core.svn.wordpress.org/trunk@38750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-10-17 16:23:28 +00:00
parent 969e4255a9
commit 11cb0c06a7
3 changed files with 3 additions and 3 deletions

View File

@ -397,7 +397,7 @@
} }
self.pages[ type + ':' + object ] = -1; self.pages[ type + ':' + object ] = -1;
return; return;
} else if ( 'page' === object ) { } else if ( ( 'page' === object ) && ( ! availableMenuItemContainer.hasClass( 'open' ) ) ) {
availableMenuItemContainer.find( '.accordion-section-title > button' ).click(); availableMenuItemContainer.find( '.accordion-section-title > button' ).click();
} }
items = new api.Menus.AvailableItemCollection( items ); // @todo Why is this collection created and then thrown away? items = new api.Menus.AvailableItemCollection( items ); // @todo Why is this collection created and then thrown away?

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7-alpha-38806'; $wp_version = '4.7-alpha-38807';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.