mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-08 17:22:31 +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
@@ -129,12 +129,14 @@ $(function () {
|
||||
})
|
||||
|
||||
test("should destroy tooltip", function () {
|
||||
var tooltip = $('<div/>').tooltip()
|
||||
var tooltip = $('<div/>').tooltip().on('click.foo', 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('destroy')
|
||||
ok(!tooltip.data('tooltip'), 'tooltip does not have data')
|
||||
ok(!tooltip.data('events'), 'tooltip does not have any events')
|
||||
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')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user