mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Arrow replacement
This commit is contained in:
parent
d9a0abaa06
commit
5b0f956a60
23
js/tests/unit/bootstrap-tooltip.js
vendored
23
js/tests/unit/bootstrap-tooltip.js
vendored
@ -290,5 +290,26 @@ $(function () {
|
||||
ok(tooltip.offset().top + tooltip.outerHeight() <= tooltiped.offset().top);
|
||||
container.remove();
|
||||
}, 100)
|
||||
})
|
||||
});
|
||||
|
||||
test("arrow should point to element", function(){
|
||||
var container = $("<div />").appendTo("body")
|
||||
.css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300})
|
||||
, p = $("<p style='margin-top:200px' />").appendTo(container)
|
||||
, tooltiped = $("<a href='#' title='very very very very very very very long tooltip'>Hover me</a>")
|
||||
.css({marginTop: 200})
|
||||
.appendTo(p)
|
||||
.tooltip({placement: "top", animate: false})
|
||||
.tooltip("show");
|
||||
|
||||
stop();
|
||||
|
||||
setTimeout(function(){
|
||||
var arrow = container.find(".tooltip-arrow");
|
||||
|
||||
start();
|
||||
ok(Math.abs(arrow.offset().left - tooltiped.offset().left - tooltiped.outerWidth()/2) <= 1);
|
||||
container.remove();
|
||||
}, 100);
|
||||
});
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user