window.innerHeight) { content.style.overflow = "hidden"; this.style.minHeight = (window.innerHeight - parseInt(this.top) - kBottomMargin) + "px"; } let HALF_ARROW_WIDTH = 16; let anchorClass = ""; let hideArrow = false; if (horizPos == 0) { container.orient = "vertical"; arrowbox.orient = ""; if (vertPos == 0) { hideArrow = true; } else { let anchorPosX = 0.5; // check for hasAttribute because, in some cases, anchorNode is actually a rect if (this.anchorNode && this.anchorNode.hasAttribute && this.anchorNode.hasAttribute("anchorPosX")) anchorPosX = parseFloat(this.anchorNode.getAttribute("anchorPosX")) || 0.5; arrowbox.style.marginLeft = ((targetRect.left - popupRect.left) + (targetRect.width * anchorPosX) - HALF_ARROW_WIDTH) + "px"; if (vertPos == 1) { container.dir = "normal"; anchorClass = "top"; } else if (vertPos == -1) { container.dir = "reverse"; anchorClass = "bottom"; } } } else if (vertPos == 0) { container.orient = ""; arrowbox.orient = "vertical"; let anchorPosY = 0.5; // check for hasAttribute because, in some cases, anchorNode is actually a rect if (this.anchorNode && this.anchorNode.hasAttribute && this.anchorNode.hasAttribute("anchorPosY")) anchorPosY = parseFloat(this.anchorNode.getAttribute("anchorPosY")) || 0.5; arrowbox.style.marginTop = ((targetRect.top - popupRect.top) + (targetRect.height * anchorPosY) - HALF_ARROW_WIDTH) + "px"; if (horizPos == 1) { container.dir = "ltr"; anchorClass = "left"; } else if (horizPos == -1) { container.dir = "rtl"; anchorClass = "right"; } } else { hideArrow = true; } arrow.hidden = hideArrow; arrow.setAttribute("side", anchorClass); ]]> null window.innerWidth) left = window.innerWidth - popupRect.width; else if (left < 0) left = 1; popupRect.left = left; this.setAttribute("left", left); popupRect.top = top; this.setAttribute("top", top); } else { horizPos = (Math.round(popupRect.right) <= Math.round(anchorRect.left + offset)) ? -1 : (Math.round(popupRect.left) >= Math.round(anchorRect.right - offset)) ? 1 : 0; vertPos = (Math.round(popupRect.bottom) <= Math.round(anchorRect.top + offset)) ? -1 : (Math.round(popupRect.top) >= Math.round(anchorRect.bottom - offset)) ? 1 : 0; } this._updateArrow(popupRect, anchorRect, horizPos, vertPos); ]]>