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:
Vendored
+4
-2
@@ -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')
|
||||
})
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user