From 8206a9d2257873760e1c96d05c6bb58721fe338c Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 19 Oct 2017 18:37:10 +0000 Subject: [PATCH] Customize: Prevent re-highlighting "Add Items" button after available nav menu items pane has already been opened. Amends [41930]. Props bpayton. See #42114. git-svn-id: https://develop.svn.wordpress.org/trunk@41950 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 71b264a72d..4f0cf05265 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -786,15 +786,19 @@ canceled = true; } - // Remove animation class in case it was already applied. - button.removeClass( animationClass ); - params.focusTarget.on( 'focusin', cancelReminder ); setTimeout( function() { params.focusTarget.off( 'focusin', cancelReminder ); if ( ! canceled ) { button.addClass( animationClass ); + button.one( 'animationend', function() { + /* + * Remove animation class to avoid situations in Customizer where + * DOM nodes are moved (re-inserted) and the animation repeats. + */ + button.removeClass( animationClass ); + } ); } }, params.delay );