diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js index e908998952..a0de0f08dc 100644 --- a/js/bootstrap-popover.js +++ b/js/bootstrap-popover.js @@ -41,7 +41,7 @@ $tip.find('.title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) $tip.find('.content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) - $tip[0].className = 'popover' + $tip.removeClass('fade top bottom left right in') } , hasContent: function () { @@ -92,4 +92,4 @@ , template: '

' }) -}( window.jQuery ) \ No newline at end of file +}( window.jQuery ) diff --git a/js/tests/unit/bootstrap-popover.js b/js/tests/unit/bootstrap-popover.js index 9180c043e9..462db8b3e1 100644 --- a/js/tests/unit/bootstrap-popover.js +++ b/js/tests/unit/bootstrap-popover.js @@ -70,5 +70,24 @@ $(function () { ok(!$('.popover').length, 'popover was removed') $('#qunit-fixture').empty() }) + + test("should respect custom classes", function() { + $.support.transition = false + var popover = $('@fat') + .appendTo('#qunit-fixture') + .popover({ + title: 'Test' + , content: 'Test' + , template: '

' + }) + + popover.popover('show') + console.log(popover) + ok($('.popover').length, 'popover was inserted') + ok($('.popover').hasClass('foobar'), 'custom class is present') + popover.popover('hide') + ok(!$('.popover').length, 'popover was removed') + $('#qunit-fixture').empty() + }) }) \ No newline at end of file