aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/widget.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/widget.js b/ui/widget.js
index 04daaa883..69240f92c 100644
--- a/ui/widget.js
+++ b/ui/widget.js
@@ -499,6 +499,8 @@ $.Widget.prototype = {
}, options );
function bindRemoveEvent() {
+ var nodesToBind = [];
+
options.element.each( function( _, element ) {
var isTracked = $.map( that.classesElementLookup, function( elements ) {
return elements;
@@ -508,11 +510,13 @@ $.Widget.prototype = {
} );
if ( !isTracked ) {
- that._on( $( element ), {
- remove: "_untrackClassesElement"
- } );
+ nodesToBind.push( element );
}
} );
+
+ that._on( $( nodesToBind ), {
+ remove: "_untrackClassesElement"
+ } );
}
function processClassString( classes, checkOption ) {