mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
commit
c6b62f0cd9
5 changed files with 40 additions and 0 deletions
|
@ -293,6 +293,10 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
|
|||
<td>hidden.bs.popover</td>
|
||||
<td>This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>inserted.bs.popover</td>
|
||||
<td>This event is fired after the <code>show.bs.popover</code> event when the popover template has been added to the DOM.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.table-responsive -->
|
||||
|
|
|
@ -260,6 +260,10 @@ $('#example').tooltip(options)
|
|||
<td>hidden.bs.tooltip</td>
|
||||
<td>This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>inserted.bs.tooltip</td>
|
||||
<td>This event is fired after the <code>show.bs.tooltip</code> event when the tooltip template has been added to the DOM.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.table-responsive -->
|
||||
|
|
|
@ -259,4 +259,21 @@ $(function () {
|
|||
assert.strictEqual($popover.data('bs.popover'), undefined, 'should not initialize the popover')
|
||||
})
|
||||
|
||||
QUnit.test('should fire inserted event', function (assert) {
|
||||
assert.expect(2)
|
||||
var done = assert.async()
|
||||
|
||||
$('<a href="#">@Johann-S</a>')
|
||||
.appendTo('#qunit-fixture')
|
||||
.on('inserted.bs.popover', function () {
|
||||
assert.notEqual($('.popover').length, 0, 'popover was inserted')
|
||||
assert.ok(true, 'inserted event fired')
|
||||
done()
|
||||
})
|
||||
.bootstrapPopover({
|
||||
title: 'Test',
|
||||
content: 'Test'
|
||||
})
|
||||
.bootstrapPopover('show')
|
||||
})
|
||||
})
|
||||
|
|
|
@ -139,6 +139,20 @@ $(function () {
|
|||
.bootstrapTooltip('show')
|
||||
})
|
||||
|
||||
QUnit.test('should fire inserted event', function (assert) {
|
||||
assert.expect(2)
|
||||
var done = assert.async()
|
||||
|
||||
$('<div title="tooltip title"/>')
|
||||
.appendTo('#qunit-fixture')
|
||||
.on('inserted.bs.tooltip', function () {
|
||||
assert.notEqual($('.tooltip').length, 0, 'tooltip was inserted')
|
||||
assert.ok(true, 'inserted event fired')
|
||||
done()
|
||||
})
|
||||
.bootstrapTooltip('show')
|
||||
})
|
||||
|
||||
QUnit.test('should fire shown event', function (assert) {
|
||||
assert.expect(1)
|
||||
var done = assert.async()
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.data('bs.' + this.type, this)
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
this.$element.trigger('inserted.bs.' + this.type)
|
||||
|
||||
var pos = this.getPosition()
|
||||
var actualWidth = $tip[0].offsetWidth
|
||||
|
|
Loading…
Reference in a new issue