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

Bug 1648089: Fix help window position when content too long



behatnotneeded

Change-Id: I0fbbd64068f272a6977b9f3a927e5bca99bcf731
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 466e66ca
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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