Bug 932218 - Hides previous image preview tooltip in markup view when another one shows. r=bgrins

This commit is contained in:
Patrick Brosset 2013-10-31 23:10:44 -04:00
parent 09c7600763
commit 27ed3bf1ce

View File

@ -181,6 +181,10 @@ Tooltip.prototype = {
this.stopTogglingOnHover();
}
// If no targetNodeCb callback is provided, then we need to hide the tooltip
// on mouseleave since baseNode is the target node itself
this._hideOnMouseLeave = !targetNodeCb;
this._basedNode = baseNode;
this._showDelay = showDelay;
this._targetNodeCb = targetNodeCb || (() => true);
@ -221,7 +225,7 @@ Tooltip.prototype = {
},
_showOnHover: function(target) {
if (this._targetNodeCb && this._targetNodeCb(target, this)) {
if (this._targetNodeCb(target, this)) {
this.show(target);
this._lastHovered = target;
}
@ -230,6 +234,9 @@ Tooltip.prototype = {
_onBaseNodeMouseLeave: function() {
clearNamedTimeout(this.uid);
this._lastHovered = null;
if (this._hideOnMouseLeave) {
this.hide();
}
},
/**