mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-25 04:12:55 +01:00
Fix tooltip occasionally not hiding when using a hide delay
Fixes #14375. Closes #14519 by merging it.
This commit is contained in:
parent
783eced7ab
commit
9740d8bb69
@ -928,6 +928,36 @@ $(function () {
|
|||||||
$tooltip.trigger('mouseenter')
|
$tooltip.trigger('mouseenter')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('should hide tip after hide delay even if moused left before end of fade in', function () {
|
||||||
|
stop()
|
||||||
|
|
||||||
|
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip for test"/>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.bootstrapTooltip({ delay: { show: 10, hide: 10 }})
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$tooltip.data('bs.tooltip').$tip, '1ms: tooltip exists')
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
ok($tooltip.data('bs.tooltip').$tip.is('.fade.in'), '10ms: tooltip faded in')
|
||||||
|
}, 10)
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
ok($tooltip.data('bs.tooltip').$tip.is('.fade.in'), '15ms: tooltip faded in')
|
||||||
|
|
||||||
|
$tooltip.trigger('mouseout')
|
||||||
|
}, 15)
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$tooltip.data('bs.tooltip').$tip.is('.fade.in'), '30ms: tooltip faded out')
|
||||||
|
|
||||||
|
start()
|
||||||
|
}, 30)
|
||||||
|
}, 0)
|
||||||
|
|
||||||
|
$tooltip.trigger('mouseenter')
|
||||||
|
})
|
||||||
|
|
||||||
test('should correctly position tooltips on SVG elements', function () {
|
test('should correctly position tooltips on SVG elements', function () {
|
||||||
if (!window.SVGElement) {
|
if (!window.SVGElement) {
|
||||||
// Skip IE8 since it doesn't support SVG
|
// Skip IE8 since it doesn't support SVG
|
||||||
|
@ -207,8 +207,11 @@
|
|||||||
this.applyPlacement(calculatedOffset, placement)
|
this.applyPlacement(calculatedOffset, placement)
|
||||||
|
|
||||||
var complete = function () {
|
var complete = function () {
|
||||||
|
var prevHoverState = that.hoverState
|
||||||
that.$element.trigger('shown.bs.' + that.type)
|
that.$element.trigger('shown.bs.' + that.type)
|
||||||
that.hoverState = null
|
that.hoverState = null
|
||||||
|
|
||||||
|
if (prevHoverState == 'out') that.leave(that)
|
||||||
}
|
}
|
||||||
|
|
||||||
$.support.transition && this.$tip.hasClass('fade') ?
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user