aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.tooltip.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index b56d939e8..1be56c7ea 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -207,6 +207,7 @@ $.widget( "ui.tooltip", {
_open: function( event, target, content ) {
var tooltip, positionOption, events;
+
if ( !content ) {
return;
}
@@ -268,6 +269,9 @@ $.widget( "ui.tooltip", {
fakeEvent.currentTarget = target[0];
this.close( fakeEvent, true );
}
+ },
+ remove: function( event ) {
+ this._removeTooltip( tooltip );
}
};
if ( !event || event.type === "mouseover" ) {
@@ -299,12 +303,15 @@ $.widget( "ui.tooltip", {
tooltip.stop( true );
this._hide( tooltip, this.options.hide, function() {
- $( this ).remove();
- delete that.tooltips[ this.id ];
+ that._removeTooltip( $( this ) );
});
target.removeData( "tooltip-open" );
this._off( target, "mouseleave focusout keyup" );
+ // Remove 'remove' binding only on delegated targets
+ if ( target[0] !== this.element[0] ) {
+ this._off( target, "remove" );
+ }
this._off( this.document, "mousemove" );
if ( event && event.type === "mouseleave" ) {
@@ -344,6 +351,11 @@ $.widget( "ui.tooltip", {
return id ? $( "#" + id ) : $();
},
+ _removeTooltip: function( tooltip ) {
+ tooltip.remove();
+ delete this.tooltips[ tooltip.attr( "id" ) ];
+ },
+
_destroy: function() {
var that = this;