File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { t } from "./i18n.js";
10
10
11
11
// Track all elements that open tooltips
12
12
let openTooltipElements : JQuery < HTMLElement > [ ] = [ ] ;
13
+ let dismissTimer : ReturnType < typeof setTimeout > ;
13
14
14
15
function setupGlobalTooltip ( ) {
15
16
$ ( document ) . on ( "mouseenter" , "a" , mouseEnterHandler ) ;
@@ -26,6 +27,7 @@ function setupGlobalTooltip() {
26
27
}
27
28
28
29
function dismissAllTooltips ( ) {
30
+ clearTimeout ( dismissTimer ) ;
29
31
openTooltipElements . forEach ( $el => {
30
32
$el . tooltip ( "dispose" ) ;
31
33
$el . removeAttr ( "aria-describedby" ) ;
@@ -129,11 +131,11 @@ async function mouseEnterHandler(this: HTMLElement) {
129
131
// cursor is neither over the link nor over the tooltip, user likely is not interested
130
132
dismissAllTooltips ( ) ;
131
133
} else {
132
- setTimeout ( checkTooltip , 1000 ) ;
134
+ dismissTimer = setTimeout ( checkTooltip , 1000 ) ;
133
135
}
134
136
} ;
135
137
136
- setTimeout ( checkTooltip , 1000 ) ;
138
+ dismissTimer = setTimeout ( checkTooltip , 1000 ) ;
137
139
}
138
140
}
139
141
You can’t perform that action at this time.
0 commit comments