Skip to content

Commit 979e468

Browse files
committed
fixup! Widget: Avoid tracking remove event handlers for classes options
1 parent ac971a6 commit 979e468

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/widget.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ $.Widget.prototype = {
514514
}
515515
}
516516

517-
// Don't use ._on() because we want to avoid additional processing for
518-
// tracking the event bindings.
519-
options.element.one( "remove", $.proxy( this, "_untrackClassesElement" ) );
517+
this._on( options.element, {
518+
remove: "_untrackClassesElement"
519+
} );
520520

521521
if ( options.keys ) {
522522
processClassString( options.keys.match( /\S+/g ) || [], true );
@@ -535,6 +535,8 @@ $.Widget.prototype = {
535535
that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
536536
}
537537
} );
538+
539+
this._off( event.target );
538540
},
539541

540542
_removeClass: function( element, keys, extra ) {

0 commit comments

Comments
 (0)