mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
parent
de1eaef35b
commit
95ce03f000
@ -332,4 +332,36 @@ $(function () {
|
||||
done()
|
||||
}
|
||||
})
|
||||
|
||||
QUnit.test('should hide popovers when their containing modal is closed', function (assert) {
|
||||
assert.expect(1)
|
||||
var done = assert.async()
|
||||
var templateHTML = '<div id="modal-test" class="modal">' +
|
||||
'<div class="modal-dialog" role="document">' +
|
||||
'<div class="modal-content">' +
|
||||
'<div class="modal-body">' +
|
||||
'<button id="popover-test" type="button" class="btn btn-secondary" data-toggle="popover" data-placement="top" data-content="Popover">' +
|
||||
'Popover on top' +
|
||||
'</button>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
|
||||
$(templateHTML).appendTo('#qunit-fixture')
|
||||
$('#popover-test')
|
||||
.on('shown.bs.popover', function () {
|
||||
$('#modal-test').modal('hide')
|
||||
})
|
||||
.on('hide.bs.popover', function () {
|
||||
assert.ok(true, 'popover hide')
|
||||
done()
|
||||
})
|
||||
|
||||
$('#modal-test')
|
||||
.on('shown.bs.modal', function () {
|
||||
$('#popover-test').bootstrapPopover('show')
|
||||
})
|
||||
.modal('show')
|
||||
})
|
||||
})
|
||||
|
@ -839,4 +839,34 @@ $(function () {
|
||||
assert.ok(showingTooltip(), 'tooltip is faded in again')
|
||||
})
|
||||
|
||||
QUnit.test('should hide tooltip when their containing modal is closed', function (assert) {
|
||||
assert.expect(1)
|
||||
var done = assert.async()
|
||||
var templateHTML = '<div id="modal-test" class="modal">' +
|
||||
'<div class="modal-dialog" role="document">' +
|
||||
'<div class="modal-content">' +
|
||||
'<div class="modal-body">' +
|
||||
'<a id="tooltipTest" href="#" data-toggle="tooltip" title="Some tooltip text!">Tooltip</a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
|
||||
$(templateHTML).appendTo('#qunit-fixture')
|
||||
$('#tooltipTest')
|
||||
.bootstrapTooltip({ trigger: 'manuel' })
|
||||
.on('shown.bs.tooltip', function () {
|
||||
$('#modal-test').modal('hide')
|
||||
})
|
||||
.on('hide.bs.tooltip', function () {
|
||||
assert.ok(true, 'tooltip hide')
|
||||
done()
|
||||
})
|
||||
|
||||
$('#modal-test')
|
||||
.on('shown.bs.modal', function () {
|
||||
$('#tooltipTest').bootstrapTooltip('show')
|
||||
})
|
||||
.modal('show')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user