mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-06 02:00:05 +00:00
Twenty Fifteen: Only re-initialize the main navigation in the Customizer when it is specifically updated.
* Fix a bug where updating the social menu links would cause the main navigation to get its toggle-expanded buttons duplicated. * Persist any existing submenu expanded states on the updated menu. * Improve naming of `customize-preview-menu-refreshed` event param from `wpNavArgs` to `wpNavMenuArgs` (old name is retained and marked as deprecated). Fixes #33177. git-svn-id: https://develop.svn.wordpress.org/trunk@33491 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -174,7 +174,7 @@
|
||||
* @param {int} instanceNumber
|
||||
*/
|
||||
refreshMenuInstance : function( instanceNumber ) {
|
||||
var data, menuId, customized, container, request, wpNavArgs, instance, containerInstanceClassName;
|
||||
var data, menuId, customized, container, request, wpNavMenuArgs, instance, containerInstanceClassName;
|
||||
|
||||
if ( ! settings.navMenuInstanceArgs[ instanceNumber ] ) {
|
||||
throw new Error( 'unknown_instance_number' );
|
||||
@@ -227,10 +227,10 @@
|
||||
data.customized = JSON.stringify( customized );
|
||||
data[ settings.renderNoncePostKey ] = settings.renderNonceValue;
|
||||
|
||||
wpNavArgs = $.extend( {}, instance );
|
||||
data.wp_nav_menu_args_hash = wpNavArgs.args_hash;
|
||||
delete wpNavArgs.args_hash;
|
||||
data.wp_nav_menu_args = JSON.stringify( wpNavArgs );
|
||||
wpNavMenuArgs = $.extend( {}, instance );
|
||||
data.wp_nav_menu_args_hash = wpNavMenuArgs.args_hash;
|
||||
delete wpNavMenuArgs.args_hash;
|
||||
data.wp_nav_menu_args = JSON.stringify( wpNavMenuArgs );
|
||||
|
||||
container.addClass( 'customize-partial-refreshing' );
|
||||
|
||||
@@ -252,7 +252,8 @@
|
||||
previousContainer.replaceWith( container );
|
||||
eventParam = {
|
||||
instanceNumber: instanceNumber,
|
||||
wpNavArgs: wpNavArgs,
|
||||
wpNavArgs: wpNavMenuArgs, // @deprecated
|
||||
wpNavMenuArgs: wpNavMenuArgs,
|
||||
oldContainer: previousContainer,
|
||||
newContainer: container
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user