Tooltip: Make sure we have a target before trying to open the tooltip.

This commit is contained in:
Scott González 2011-02-26 15:06:06 +01:00
parent b4d75c1083
commit 31a181abfc

View File

@ -68,6 +68,9 @@ $.widget("ui.tooltip", {
open: function(event) { open: function(event) {
var target = $(event && event.target || this.element).closest(this.options.items); var target = $(event && event.target || this.element).closest(this.options.items);
if ( !target.length ) {
return;
}
// already visible? possible when both focus and mouseover events occur // already visible? possible when both focus and mouseover events occur
if (this.current && this.current[0] == target[0]) if (this.current && this.current[0] == target[0])
return; return;