16
16
17
17
var increments = 0 ;
18
18
19
- $ . widget ( "ui.tooltip" , {
19
+ $ . widget ( "ui.tooltip" , {
20
20
options : {
21
21
tooltipClass : null ,
22
22
items : "[title]" ,
@@ -56,15 +56,16 @@ $.widget("ui.tooltip", {
56
56
target . data ( "tooltip-title" , target . attr ( "title" ) ) ;
57
57
}
58
58
var content = this . options . content . call ( target [ 0 ] , function ( response ) {
59
- // IE may instantly serve a cached response, need to give it a chance to finish with _open before that
59
+ // IE may instantly serve a cached response for ajax requests
60
+ // delay this call to _open so the other call to _open runs first
60
61
setTimeout ( function ( ) {
61
62
// when undefined, it got removeAttr, then ignore (ajax response)
62
63
// initially its an empty string, so not undefined
63
64
// TODO is there a better approach to enable ajax tooltips to have two updates?
64
65
if ( target . attr ( "aria-describedby" ) !== undefined ) {
65
66
that . _open ( event , target , response ) ;
66
67
}
67
- } , 13 ) ;
68
+ } , 1 ) ;
68
69
} ) ;
69
70
if ( content ) {
70
71
that . _open ( event , target , content ) ;
@@ -127,6 +128,7 @@ $.widget("ui.tooltip", {
127
128
$ ( this ) . remove ( ) ;
128
129
} ) ;
129
130
131
+ // TODO: why isn't click unbound here?
130
132
target . unbind ( "mouseleave.tooltip blur.tooltip" ) ;
131
133
132
134
this . _trigger ( "close" , event ) ;
@@ -149,7 +151,7 @@ $.widget("ui.tooltip", {
149
151
150
152
_find : function ( target ) {
151
153
var id = target . attr ( "aria-describedby" ) ;
152
- return id ? $ ( document . getElementById ( id ) ) : $ ( ) ;
154
+ return id ? $ ( "#" + id ) : $ ( ) ;
153
155
}
154
156
} ) ;
155
157
0 commit comments