mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 02:24:19 +02:00
Merge pull request #907 from ansman/2.0-wip
Twipsy now respects custom classes
This commit is contained in:
2
js/bootstrap-twipsy.js
vendored
2
js/bootstrap-twipsy.js
vendored
@@ -155,7 +155,7 @@
|
|||||||
, setContent: function () {
|
, setContent: function () {
|
||||||
var $tip = this.tip()
|
var $tip = this.tip()
|
||||||
$tip.find('.twipsy-inner').html(this.getTitle())
|
$tip.find('.twipsy-inner').html(this.getTitle())
|
||||||
$tip[0].className = 'twipsy'
|
$tip.removeClass('fade in top bottom left right')
|
||||||
}
|
}
|
||||||
|
|
||||||
, hide: function () {
|
, hide: function () {
|
||||||
|
11
js/tests/unit/bootstrap-twipsy.js
vendored
11
js/tests/unit/bootstrap-twipsy.js
vendored
@@ -48,4 +48,15 @@ $(function () {
|
|||||||
ok(!$(".twipsy").length, 'twipsy removed')
|
ok(!$(".twipsy").length, 'twipsy removed')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("should respect custom classes", function () {
|
||||||
|
var twipsy = $('<a href="#" rel="twipsy" title="Another twipsy"></a>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.twipsy({ template: '<div class="twipsy some-class"><div class="twipsy-arrow"/><div class="twipsy-inner"/></div>'})
|
||||||
|
.twipsy('show')
|
||||||
|
|
||||||
|
ok($('.twipsy').hasClass('some-class'), 'custom class is present')
|
||||||
|
twipsy.twipsy('hide')
|
||||||
|
ok(!$(".twipsy").length, 'twipsy removed')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
Reference in New Issue
Block a user