1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-19 11:51:23 +02:00

on destroy, also hide. issue #3880, pull #4104

This commit is contained in:
Jon Stevens
2012-07-20 09:47:12 -07:00
parent 2ee9b2717b
commit 117f65d431
5 changed files with 8 additions and 2 deletions

View File

@@ -72,6 +72,7 @@
}
, destroy: function () {
this.hide()
this.$element.off(this.options.ns).removeData('popover')
}

View File

@@ -236,6 +236,7 @@
}
, destroy: function () {
this.hide()
this.$element.off(this.options.ns).removeData('tooltip')
}

View File

@@ -96,7 +96,9 @@ $(function () {
ok(popover.data('popover'), 'popover has data')
ok(popover.data('events').mouseover && popover.data('events').mouseout, 'popover has hover event')
ok(popover.data('events').click[0].namespace == 'foo', 'popover has extra click.foo event')
popover.popover('show')
popover.popover('destroy')
ok(!popover.hasClass('in'), 'popover is hidden')
ok(!popover.data('popover'), 'popover does not have data')
ok(popover.data('events').click[0].namespace == 'foo', 'popover still has click.foo')
ok(!popover.data('events').mouseover && !popover.data('events').mouseout, 'popover does not have any events')

View File

@@ -133,7 +133,9 @@ $(function () {
ok(tooltip.data('tooltip'), 'tooltip has data')
ok(tooltip.data('events').mouseover && tooltip.data('events').mouseout, 'tooltip has hover event')
ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
tooltip.tooltip('show')
tooltip.tooltip('destroy')
ok(!tooltip.hasClass('in'), 'tooltip is hidden')
ok(!tooltip.data('tooltip'), 'tooltip does not have data')
ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip still has click.foo')
ok(!tooltip.data('events').mouseover && !tooltip.data('events').mouseout, 'tooltip does not have any events')