diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-05-28 11:43:57 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-28 11:43:57 -0400 |
commit | d43118dfbab9591caa5181a9e50608921d19bd5b (patch) | |
tree | c219505360c2619929c3135834e0846743db722e /ui/jquery.ui.tooltip.js | |
parent | d4f6f17c8de859bcc4b76e15e523fb8b74703afe (diff) | |
download | jquery-ui-d43118dfbab9591caa5181a9e50608921d19bd5b.tar.gz jquery-ui-d43118dfbab9591caa5181a9e50608921d19bd5b.zip |
Tooltip: Cleanup.
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r-- | ui/jquery.ui.tooltip.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index c0aaa4fbe..756fe0f7b 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -16,7 +16,7 @@ var increments = 0; -$.widget("ui.tooltip", { +$.widget( "ui.tooltip", { options: { tooltipClass: null, items: "[title]", @@ -56,7 +56,8 @@ $.widget("ui.tooltip", { target.data( "tooltip-title", target.attr( "title" ) ); } var content = this.options.content.call( target[0], function( response ) { - // IE may instantly serve a cached response, need to give it a chance to finish with _open before that + // IE may instantly serve a cached response for ajax requests + // delay this call to _open so the other call to _open runs first setTimeout(function() { // when undefined, it got removeAttr, then ignore (ajax response) // initially its an empty string, so not undefined @@ -64,7 +65,7 @@ $.widget("ui.tooltip", { if ( target.attr( "aria-describedby" ) !== undefined ) { that._open( event, target, response ); } - }, 13 ); + }, 1 ); }); if ( content ) { that._open( event, target, content ); @@ -127,6 +128,7 @@ $.widget("ui.tooltip", { $( this ).remove(); }); + // TODO: why isn't click unbound here? target.unbind( "mouseleave.tooltip blur.tooltip" ); this._trigger( "close", event ); @@ -149,7 +151,7 @@ $.widget("ui.tooltip", { _find: function( target ) { var id = target.attr( "aria-describedby" ); - return id ? $( document.getElementById( id ) ) : $(); + return id ? $( "#" + id ) : $(); } }); |