src/features/ParameterHintsManager.js
function positionHint(xpos, ypos, ybot) {
        var hintWidth = $hintContainer.width(),
            hintHeight = $hintContainer.height(),
            top = ypos - hintHeight - POINTER_TOP_OFFSET,
            left = xpos,
            $editorHolder = $("#editor-holder"),
            editorLeft;

        if ($editorHolder.offset() === undefined) {
            // this happens in jasmine tests that run
            // without a windowed document.
            return;
        }

        editorLeft = $editorHolder.offset().left;
        left = Math.max(left, editorLeft);
        left = Math.min(left, editorLeft + $editorHolder.width() - hintWidth);

        if (top < 0) {
            $hintContainer.removeClass("preview-bubble-above");
            $hintContainer.addClass("preview-bubble-below");
            top = ybot + POSITION_BELOW_OFFSET;
            $hintContainer.offset({
                left: left,
                top: top
            });
        } else {
            $hintContainer.removeClass("preview-bubble-below");
            $hintContainer.addClass("preview-bubble-above");
            $hintContainer.offset({
                left: left,
                top: top - POINTER_TOP_OFFSET
            });
        }
    }
function positionHint(xpos, ypos, ybot) {
        var hintWidth = $hintContainer.width(),
            hintHeight = $hintContainer.height(),
            top = ypos - hintHeight - POINTER_TOP_OFFSET,
            left = xpos,
            $editorHolder = $("#editor-holder"),
            editorLeft;

        if ($editorHolder.offset() === undefined) {
            // this happens in jasmine tests that run
            // without a windowed document.
            return;
        }

        editorLeft = $editorHolder.offset().left;
        left = Math.max(left, editorLeft);
        left = Math.min(left, editorLeft + $editorHolder.width() - hintWidth);

        if (top < 0) {
            $hintContainer.removeClass("preview-bubble-above");
            $hintContainer.addClass("preview-bubble-below");
            top = ybot + POSITION_BELOW_OFFSET;
            $hintContainer.offset({
                left: left,
                top: top
            });
        } else {
            $hintContainer.removeClass("preview-bubble-below");
            $hintContainer.addClass("preview-bubble-above");
            $hintContainer.offset({
                left: left,
                top: top - POINTER_TOP_OFFSET
            });
        }
    }
function positionHint ( xpos , ypos , ybot ) { var hintWidth = $hintContainer . width ( ) , hintHeight = $hintContainer . height ( ) , top = ypos - hintHeight - POINTER_TOP_OFFSET , left = xpos , $editorHolder = $ ( "#editor-holder" ) , editorLeft ; if ( $editorHolder . offset ( ) === undefined ) { // this happens in jasmine tests that run // without a windowed document. return ; } editorLeft = $editorHolder . offset ( ) . left ; left = Math . max ( left , editorLeft ) ; left = Math . min ( left , editorLeft + $editorHolder . width ( ) - hintWidth ) ; if ( top < 0 ) { $hintContainer . removeClass ( "preview-bubble-above" ) ; $hintContainer . addClass ( "preview-bubble-below" ) ; top = ybot + POSITION_BELOW_OFFSET ; $hintContainer . offset ( { left : left , top : top } ) ; } else { $hintContainer . removeClass ( "preview-bubble-below" ) ; $hintContainer . addClass ( "preview-bubble-above" ) ; $hintContainer . offset ( { left : left , top : top - POINTER_TOP_OFFSET } ) ; } }
Position a function hint.

@param {number} xpos
@param {number} ypos
@param {number} ybot
Position a function hint .