2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-02 16:04:07 +03:00

Fix toggle for Tooltips/Popover which was called even if the Tooltip/Popover was disabled

This commit is contained in:
Johann-S
2017-08-24 09:40:11 +02:00
parent 3a6fc265f6
commit 4571ab0e57
3 changed files with 50 additions and 2 deletions
+22
View File
@@ -826,4 +826,26 @@ $(function () {
$el.bootstrapTooltip('show')
})
QUnit.test('tooltip should be shown right away after the call of disable/enable', function (assert) {
assert.expect(2)
var done = assert.async()
var $trigger = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>')
.appendTo('#qunit-fixture')
.bootstrapTooltip()
.on('shown.bs.tooltip', function () {
assert.strictEqual($('.tooltip').hasClass('show'), true)
done()
})
$trigger.bootstrapTooltip('disable')
$trigger.trigger($.Event('click'))
setTimeout(function () {
assert.strictEqual($('.tooltip').length === 0, true)
$trigger.bootstrapTooltip('enable')
$trigger.trigger($.Event('click'))
}, 200)
})
})