From d3426f984cd889dc4a11768a70f6705f6ef67cb4 Mon Sep 17 00:00:00 2001
From: Brandon Payton <brandon@happycode.net>
Date: Thu, 19 Oct 2017 15:21:31 +0200
Subject: [PATCH] Avoid re-triggering button highlight
---
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 7b275b4d60..5f56043170 100644
a
|
b
|
|
786 | 786 | canceled = true; |
787 | 787 | } |
788 | 788 | |
789 | | // Remove animation class in case it was already applied. |
790 | | button.removeClass( animationClass ); |
791 | | |
792 | 789 | params.focusTarget.on( 'focusin', cancelReminder ); |
793 | 790 | setTimeout( function() { |
794 | 791 | params.focusTarget.off( 'focusin', cancelReminder ); |
795 | 792 | |
796 | 793 | if ( ! canceled ) { |
797 | 794 | button.addClass( animationClass ); |
| 795 | button.one( 'animationend', function () { |
| 796 | /* |
| 797 | * Remove animation class to avoid situations in Customizer where |
| 798 | * DOM nodes are moved (re-inserted) and the animation repeats. |
| 799 | */ |
| 800 | button.removeClass( animationClass ); |
| 801 | } ); |
798 | 802 | } |
799 | 803 | }, params.delay ); |
800 | 804 | |