aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tooltip.js
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-04-15 09:45:35 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-04-15 09:45:35 +0200
commit84e0ce168f109fbd5482c6c1ba09bbbb55592888 (patch)
tree2992b7c9a1a36bf227ff01b3f94ffc5913ba696b /ui/jquery.ui.tooltip.js
parentacfc66e1ab4c90897139507124de7365fee4afb9 (diff)
downloadjquery-ui-84e0ce168f109fbd5482c6c1ba09bbbb55592888.tar.gz
jquery-ui-84e0ce168f109fbd5482c6c1ba09bbbb55592888.zip
Tooltip: Unit tests for tooltip and a fix to pass through event objects to triggered events
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r--ui/jquery.ui.tooltip.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index 166bff407..13c809f45 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -49,10 +49,10 @@ $.widget("ui.tooltip", {
this.opacity = this.tooltip.css("opacity");
this.element
.bind("focus.tooltip mouseenter.tooltip", function(event) {
- self.open();
+ self.open( event );
})
.bind("blur.tooltip mouseleave.tooltip", function(event) {
- self.close();
+ self.close( event );
});
},
@@ -73,7 +73,7 @@ $.widget("ui.tooltip", {
return this.tooltip;
},
- open: function() {
+ open: function(event) {
var target = this.element;
// already visible? possible when both focus and mouseover events occur
if (this.current && this.current[0] == target[0])
@@ -84,14 +84,14 @@ $.widget("ui.tooltip", {
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._show(target, response);
+ self._show(event, target, response);
});
if (content) {
- self._show(target, content);
+ self._show(event, target, content);
}
},
- _show: function(target, content) {
+ _show: function(event, target, content) {
if (!content)
return;
@@ -116,10 +116,10 @@ $.widget("ui.tooltip", {
else
this.tooltip.is(':visible') ? this.tooltip.fadeTo("normal", this.opacity) : this.tooltip.fadeIn();
- this._trigger( "open" );
+ this._trigger( "open", event );
},
- close: function() {
+ close: function(event) {
if (!this.current)
return;
@@ -137,7 +137,7 @@ $.widget("ui.tooltip", {
else
this.tooltip.stop().fadeOut();
- this._trigger( "close" );
+ this._trigger( "close", event );
}
});