mirror of
https://github.com/twbs/bootstrap.git
synced 2025-10-04 17:21:38 +02:00
Use a single class name for opened/expanded/shown state of widgets
This commit is contained in:
@@ -111,7 +111,7 @@ $(function () {
|
||||
|
||||
assert
|
||||
.ok($('.tooltip')
|
||||
.is('.fade.bs-tether-element-attached-top.bs-tether-element-attached-center.in'), 'has correct classes applied')
|
||||
.is('.fade.bs-tether-element-attached-top.bs-tether-element-attached-center.active'), 'has correct classes applied')
|
||||
|
||||
$tooltip.bootstrapTooltip('hide')
|
||||
|
||||
@@ -293,7 +293,7 @@ $(function () {
|
||||
$tooltip.bootstrapTooltip('show')
|
||||
$tooltip.bootstrapTooltip('dispose')
|
||||
|
||||
assert.ok(!$tooltip.hasClass('in'), 'tooltip is hidden')
|
||||
assert.ok(!$tooltip.hasClass('active'), 'tooltip is hidden')
|
||||
assert.ok(!$._data($tooltip[0], 'bs.tooltip'), 'tooltip does not have data')
|
||||
assert.strictEqual($._data($tooltip[0], 'events').click[0].namespace, 'foo', 'tooltip still has click.foo')
|
||||
assert.ok(!$._data($tooltip[0], 'events').mouseover && !$._data($tooltip[0], 'events').mouseout, 'tooltip does not have hover events')
|
||||
@@ -322,7 +322,7 @@ $(function () {
|
||||
.bootstrapTooltip({ trigger: 'manual' })
|
||||
.bootstrapTooltip('toggle')
|
||||
|
||||
assert.ok($('.tooltip').is('.fade.in'), 'tooltip is faded in')
|
||||
assert.ok($('.tooltip').is('.fade.active'), 'tooltip is faded active')
|
||||
})
|
||||
|
||||
QUnit.test('should hide previously shown tooltip when toggle is called on tooltip', function (assert) {
|
||||
@@ -333,7 +333,7 @@ $(function () {
|
||||
.bootstrapTooltip('show')
|
||||
|
||||
$('.tooltip').bootstrapTooltip('toggle')
|
||||
assert.ok($('.tooltip').not('.fade.in'), 'tooltip was faded out')
|
||||
assert.ok($('.tooltip').not('.fade.active'), 'tooltip was faded out')
|
||||
})
|
||||
|
||||
QUnit.test('should place tooltips inside body when container is body', function (assert) {
|
||||
@@ -489,11 +489,11 @@ $(function () {
|
||||
.bootstrapTooltip({ delay: 150 })
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '100ms: tooltip is not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip is not faded active')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($('.tooltip').is('.fade.in'), '200ms: tooltip is faded in')
|
||||
assert.ok($('.tooltip').is('.fade.active'), '200ms: tooltip is faded active')
|
||||
done()
|
||||
}, 200)
|
||||
|
||||
@@ -509,12 +509,12 @@ $(function () {
|
||||
.bootstrapTooltip({ delay: 150 })
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '100ms: tooltip not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip not faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '200ms: tooltip not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '200ms: tooltip not faded active')
|
||||
done()
|
||||
}, 200)
|
||||
|
||||
@@ -530,16 +530,16 @@ $(function () {
|
||||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($('.tooltip').is('.fade.in'), '1ms: tooltip faded in')
|
||||
assert.ok($('.tooltip').is('.fade.active'), '1ms: tooltip faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($('.tooltip').is('.fade.in'), '100ms: tooltip still faded in')
|
||||
assert.ok($('.tooltip').is('.fade.active'), '100ms: tooltip still faded active')
|
||||
$tooltip.trigger('mouseenter')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($('.tooltip').is('.fade.in'), '200ms: tooltip still faded in')
|
||||
assert.ok($('.tooltip').is('.fade.active'), '200ms: tooltip still faded active')
|
||||
done()
|
||||
}, 200)
|
||||
}, 0)
|
||||
@@ -556,12 +556,12 @@ $(function () {
|
||||
.bootstrapTooltip({ delay: 150 })
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '100ms: tooltip not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip not faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '200ms: tooltip not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '200ms: tooltip not faded active')
|
||||
done()
|
||||
}, 200)
|
||||
|
||||
@@ -577,12 +577,12 @@ $(function () {
|
||||
.bootstrapTooltip({ delay: { show: 150, hide: 0 }})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '100ms: tooltip not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip not faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$('.tooltip').is('.fade.in'), '250ms: tooltip not faded in')
|
||||
assert.ok(!$('.tooltip').is('.fade.active'), '250ms: tooltip not faded active')
|
||||
done()
|
||||
}, 250)
|
||||
|
||||
@@ -598,16 +598,16 @@ $(function () {
|
||||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.in'), '1ms: tooltip faded in')
|
||||
assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.active'), '1ms: tooltip faded active')
|
||||
|
||||
$tooltip.trigger('mouseout')
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.in'), '100ms: tooltip still faded in')
|
||||
assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.active'), '100ms: tooltip still faded active')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok(!$($tooltip.data('bs.tooltip').tip).is('.in'), '200ms: tooltip removed')
|
||||
assert.ok(!$($tooltip.data('bs.tooltip').tip).is('.active'), '200ms: tooltip removed')
|
||||
done()
|
||||
}, 200)
|
||||
|
||||
@@ -713,7 +713,7 @@ $(function () {
|
||||
assert.ok(obj._hoverState == 'out', 'the tooltip hoverState should be set to "out"')
|
||||
|
||||
$('#tt-outer').trigger('mouseenter')
|
||||
assert.ok(obj._hoverState == 'in', 'the tooltip hoverState should be set to "in"')
|
||||
assert.ok(obj._hoverState == 'active', 'the tooltip hoverState should be set to "active"')
|
||||
|
||||
assert.strictEqual(currentUid, $('#tt-content').text())
|
||||
})
|
||||
@@ -775,7 +775,7 @@ $(function () {
|
||||
var tooltip = $el.data('bs.tooltip')
|
||||
var $tooltip = $(tooltip.getTipElement())
|
||||
|
||||
function showingTooltip() { return $tooltip.hasClass('in') || tooltip._hoverState == 'in' }
|
||||
function showingTooltip() { return $tooltip.hasClass('active') || tooltip._hoverState == 'active' }
|
||||
|
||||
var tests = [
|
||||
['mouseenter', 'mouseleave'],
|
||||
|
Reference in New Issue
Block a user