0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

clear timeout to reset delays for tooltip/popover

This commit is contained in:
Jacob Thornton 2012-03-21 21:57:06 -07:00
parent 22963d7346
commit 94b24aaa47
3 changed files with 8 additions and 4 deletions

Binary file not shown.

View File

@ -73,8 +73,9 @@
if (!self.options.delay || !self.options.delay.show) { if (!self.options.delay || !self.options.delay.show) {
self.show() self.show()
} else { } else {
clearTimeout(this.timeout)
self.hoverState = 'in' self.hoverState = 'in'
setTimeout(function() { this.timeout = setTimeout(function() {
if (self.hoverState == 'in') { if (self.hoverState == 'in') {
self.show() self.show()
} }
@ -88,8 +89,9 @@
if (!self.options.delay || !self.options.delay.hide) { if (!self.options.delay || !self.options.delay.hide) {
self.hide() self.hide()
} else { } else {
clearTimeout(this.timeout)
self.hoverState = 'out' self.hoverState = 'out'
setTimeout(function() { this.timeout = setTimeout(function() {
if (self.hoverState == 'out') { if (self.hoverState == 'out') {
self.hide() self.hide()
} }

View File

@ -73,8 +73,9 @@
if (!self.options.delay || !self.options.delay.show) { if (!self.options.delay || !self.options.delay.show) {
self.show() self.show()
} else { } else {
clearTimeout(this.timeout)
self.hoverState = 'in' self.hoverState = 'in'
setTimeout(function() { this.timeout = setTimeout(function() {
if (self.hoverState == 'in') { if (self.hoverState == 'in') {
self.show() self.show()
} }
@ -88,8 +89,9 @@
if (!self.options.delay || !self.options.delay.hide) { if (!self.options.delay || !self.options.delay.hide) {
self.hide() self.hide()
} else { } else {
clearTimeout(this.timeout)
self.hoverState = 'out' self.hoverState = 'out'
setTimeout(function() { this.timeout = setTimeout(function() {
if (self.hoverState == 'out') { if (self.hoverState == 'out') {
self.hide() self.hide()
} }