aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-01-22 12:20:39 -0800
committerJacob Thornton <[email protected]>2012-01-22 12:20:39 -0800
commita6eb972bf3f1a0ea172a44a25565df18da615f33 (patch)
treedda1221300d614b503c733afead580f6f6d8457d
parent88596797f061f97255bb7ed9442ac43a41787405 (diff)
parent4882e6da2f887c1e8baad96f777b151882adaed8 (diff)
downloadbootstrap-a6eb972bf3f1a0ea172a44a25565df18da615f33.tar.xz
bootstrap-a6eb972bf3f1a0ea172a44a25565df18da615f33.zip
Merge pull request #1101 from ansman/2.0-wip
Fix for #1102 and #1100
-rw-r--r--js/bootstrap-popover.js4
-rw-r--r--js/tests/unit/bootstrap-popover.js19
2 files changed, 21 insertions, 2 deletions
diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js
index e90899895..a0de0f08d 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: '<div class="popover"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
})
-}( 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 9180c043e..462db8b3e 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 = $('<a href="#">@fat</a>')
+ .appendTo('#qunit-fixture')
+ .popover({
+ title: 'Test'
+ , content: 'Test'
+ , template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
+ })
+
+ 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