aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.tooltip.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index 6854032f4..a8c3c14bd 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -310,11 +310,17 @@ $.widget( "ui.tooltip", {
fakeEvent.currentTarget = target[0];
this.close( fakeEvent, true );
}
- },
- remove: function() {
- this._removeTooltip( tooltip );
}
};
+
+ // Only bind remove handler for delegated targets. Non-delegated
+ // tooltips will handle this in destroy.
+ if ( target[ 0 ] !== this.element[ 0 ] ) {
+ events.remove = function() {
+ this._removeTooltip( tooltip );
+ };
+ }
+
if ( !event || event.type === "mouseover" ) {
events.mouseleave = "close";
}
@@ -353,8 +359,9 @@ $.widget( "ui.tooltip", {
target.removeData( "ui-tooltip-open" );
this._off( target, "mouseleave focusout keyup" );
+
// Remove 'remove' binding only on delegated targets
- if ( target[0] !== this.element[0] ) {
+ if ( target[ 0 ] !== this.element[ 0 ] ) {
this._off( target, "remove" );
}
this._off( this.document, "mousemove" );