aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tooltip.js
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-10-26 17:07:22 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-10-26 17:07:22 +0200
commit48a5977d3325869abd7b7ba835eb8ac331fd6eb5 (patch)
tree43fd0cda4af2cdcd33f5f2ae8205b13100caca83 /ui/jquery.ui.tooltip.js
parentbdd815e8dcdeace8be6dd8005ef443bc5ea20548 (diff)
downloadjquery-ui-48a5977d3325869abd7b7ba835eb8ac331fd6eb5.tar.gz
jquery-ui-48a5977d3325869abd7b7ba835eb8ac331fd6eb5.zip
Tooltip: Implementing event delegation support.
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r--ui/jquery.ui.tooltip.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index 91c60d603..122652bb0 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -18,6 +18,7 @@ var increments = 0;
$.widget("ui.tooltip", {
options: {
+ items: "[title]",
content: function() {
return $(this).attr("title");
},
@@ -41,10 +42,10 @@ $.widget("ui.tooltip", {
.appendTo(this.tooltip);
this.opacity = this.tooltip.css("opacity");
this.element
- .bind("focus.tooltip mouseenter.tooltip", function(event) {
+ .bind("focus.tooltip mouseover.tooltip", function(event) {
self.open( event );
})
- .bind("blur.tooltip mouseleave.tooltip", function(event) {
+ .bind("blur.tooltip mouseout.tooltip", function(event) {
self.close( event );
});
},
@@ -67,7 +68,7 @@ $.widget("ui.tooltip", {
},
open: function(event) {
- var target = this.element;
+ var target = $(event && event.target || this.element).closest(this.options.items);
// already visible? possible when both focus and mouseover events occur
if (this.current && this.current[0] == target[0])
return;