2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-14 18:42:30 +03:00

namespace the events for popover/tooltip so that they can be cleanly removed. issue #3880

This commit is contained in:
Jon Stevens
2012-07-16 16:01:11 -07:00
parent 40ab928315
commit 2ee9b2717b
5 changed files with 26 additions and 8 deletions
+4 -2
View File
@@ -92,12 +92,14 @@ $(function () {
})
test("should destroy popover", function () {
var popover = $('<div/>').popover()
var popover = $('<div/>').popover().on('click.foo', 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('destroy')
ok(!popover.data('popover'), 'popover does not have data')
ok(!popover.data('events'), 'popover does not have any events')
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')
})
})