aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/widget.js')
-rw-r--r--ui/widget.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/widget.js b/ui/widget.js
index 06a3ce88e..a3922675f 100644
--- a/ui/widget.js
+++ b/ui/widget.js
@@ -514,6 +514,10 @@ $.Widget.prototype = {
}
}
+ this._on( options.element, {
+ "remove": "_untrackClassesElement"
+ } );
+
if ( options.keys ) {
processClassString( options.keys.match( /\S+/g ) || [], true );
}
@@ -524,6 +528,15 @@ $.Widget.prototype = {
return full.join( " " );
},
+ _untrackClassesElement: function( event ) {
+ var that = this;
+ $.each( that.classesElementLookup, function( key, value ) {
+ if ( $.inArray( event.target, value ) !== -1 ) {
+ that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
+ }
+ } );
+ },
+
_removeClass: function( element, keys, extra ) {
return this._toggleClass( element, keys, extra, false );
},