Skip to content

Commit

Permalink
Merge pull request #907 from ansman/2.0-wip
Browse files Browse the repository at this point in the history
Twipsy now respects custom classes
  • Loading branch information
fat committed Jan 6, 2012
2 parents 5cb7603 + 969fbe7 commit 64c8623
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/bootstrap-twipsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
, setContent: function () {
var $tip = this.tip()
$tip.find('.twipsy-inner').html(this.getTitle())
$tip[0].className = 'twipsy'
$tip.removeClass('fade in top bottom left right')
}

, hide: function () {
Expand Down
11 changes: 11 additions & 0 deletions js/tests/unit/bootstrap-twipsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,15 @@ $(function () {
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')
})

})

0 comments on commit 64c8623

Please sign in to comment.