1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-14 01:24:19 +02:00

fixed reference to this.tip() so it works in delegate events

This commit is contained in:
Martin Stein
2012-10-15 15:17:59 +02:00
parent fa778792c5
commit 6b017b9bea
2 changed files with 11 additions and 2 deletions

View File

@@ -142,4 +142,12 @@ $(function () {
ok(!$._data(tooltip[0], 'events').mouseover && !$._data(tooltip[0], 'events').mouseout, 'tooltip does not have any events')
})
test("should show tooltip with delegate selector on click", function () {
var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>')
var tooltip = div.appendTo('#qunit-fixture')
.tooltip({ selector: 'a[rel=tooltip]',
trigger: 'click' })
div.find('a').trigger('click')
ok($(".tooltip").is('.fade.in'), 'tooltip is faded in')
})
})