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
This commit is contained in:
Weston Ruter 2017-10-19 18:37:10 +00:00
parent 4238b2895f
commit 8206a9d225
1 changed files with 7 additions and 3 deletions

View File

@ -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 );