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

Merge pull request #1101 from ansman/2.0-wip

Fix for #1102 and #1100
This commit is contained in:
Jacob Thornton 2012-01-22 12:20:39 -08:00
commit a6eb972bf3
2 changed files with 21 additions and 2 deletions

View File

@ -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 )
}( window.jQuery )

View File

@ -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()
})
})