this.opacity = this.tooltip.css("opacity");
this.element
.bind("focus.tooltip mouseenter.tooltip", function(event) {
- self.show($(event.target));
+ self.open();
})
.bind("blur.tooltip mouseleave.tooltip", function(event) {
self.close();
return this.tooltip;
},
- show: function(target) {
+ open: function() {
+ var target = this.element;
// already visible? possible when both focus and mouseover events occur
if (this.current && this.current[0] == target[0])
return;
var content = this.options.content.call(target[0], function(response) {
// ignore async responses that come in after the tooltip is already hidden
if (self.current == target)
- self.open(target, response);
+ self._show(target, response);
});
if (content) {
- self.open(target, content);
+ self._show(target, content);
}
},
- open: function(target, content) {
+ _show: function(target, content) {
if (!content)
return;
else
this.tooltip.is(':visible') ? this.tooltip.fadeTo("normal", this.opacity) : this.tooltip.fadeIn();
- this._trigger("show", null, { target: target });
+ this._trigger( "open" );
},
close: function() {
else
this.tooltip.stop().fadeOut();
+ this._trigger( "close" );
}
});