Commit c89514ad authored by Gilles-Philippe Leblanc's avatar Gilles-Philippe Leblanc Committed by Robert Lyon

Bug 1648089: Fix help window position when content too long

behatnotneeded

Change-Id: I0fbbd64068f272a6977b9f3a927e5bca99bcf731
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 466e66ca
......@@ -611,11 +611,18 @@ function contextualHelpPosition(container) {
*/
function ensureHelpIsOnScreen(container, position) {
var screenheight = $j(window).height();
var containerheight = container.height();
if (position.y + containerheight > screenheight + $j('html').scrollTop()) {
var containerheight = $j(container).height();
var scrolltop = $j('html').scrollTop();
if (position.y + containerheight > screenheight + scrolltop) {
position.y -= containerheight - 18;
container.css('top', position.y);
}
// If the popup's begin outside the screen, put it at top.
var offsettop = $j(container).offset().top;
if (offsettop < 0) {
position.y += -offsettop + scrolltop;
$j(container).css('top', position.y);
}
}
/* Only works in non-ie at the moment. Using 'document' as the element
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment