mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 02:24:19 +02:00
fix @muan's unit test ;)
This commit is contained in:
@@ -294,15 +294,15 @@ $(function () {
|
|||||||
|
|
||||||
test("should add position class before positioning so that position-specific styles are taken into account", function(){
|
test("should add position class before positioning so that position-specific styles are taken into account", function(){
|
||||||
$("head").append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>')
|
$("head").append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>')
|
||||||
|
|
||||||
var container = $("<div />").appendTo("body")
|
var container = $("<div />").appendTo("body")
|
||||||
, target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line">To my right</a>')
|
, target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line">To my right</a>')
|
||||||
.appendTo(container)
|
.appendTo(container)
|
||||||
.tooltip({placement: 'right'})
|
.tooltip({placement: 'right'})
|
||||||
.tooltip('show')
|
.tooltip('show')
|
||||||
, tooltip = container.find(".tooltip")
|
, tooltip = container.find(".tooltip")
|
||||||
|
|
||||||
ok( Math.round(target.offset().top + target[0].offsetHeight/2 - tooltip[0].offsetHeight/2) === tooltip.offset().top )
|
ok( Math.round(target.offset().top + target[0].offsetHeight/2 - tooltip[0].offsetHeight/2) === Math.round(tooltip.offset().top) )
|
||||||
target.tooltip('hide')
|
target.tooltip('hide')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user