From 13bf7d0fc05fa7f3edfb03874464fdb5cd64863c Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Fri, 19 Feb 2016 20:48:39 +0900 Subject: [PATCH] Separate method to reposition tooltip --- modules/fullTooltip.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/fullTooltip.js b/modules/fullTooltip.js index 030bcfe5..1334ea3a 100644 --- a/modules/fullTooltip.js +++ b/modules/fullTooltip.js @@ -432,15 +432,23 @@ FullTooltipManager.prototype = inherit(TreeStyleTabBase, { var tooltip = this.tabFullTooltip; { + this.setTooltipPosition(x, y); let style = tooltip.style; - style.marginLeft = x+'px'; - style.marginTop = y+'px'; style.maxWidth = style.minWidth = w+'px'; style.maxHeight = style.minHeight = h+'px'; } tooltip.openPopupAtScreen(basePosition.x, basePosition.y, false); }).bind(this), Math.max(delay, 0), this); }, + setTooltipPosition : function FTM_setTooltipPosition(aX, aY, aScreen) + { + var tooltip = this.tabFullTooltip; + var style = tooltip.style; + var box = tooltip.boxObject; + var aScreen = aScreen || this.getCurrentScreen(box); + style.marginLeft = aX+'px'; + style.marginTop = aY+'px'; + }, cancel : function FTM_cancel() { @@ -622,8 +630,7 @@ FullTooltipManager.prototype = inherit(TreeStyleTabBase, { if (tooltipTopEdge >= currentScreen.allowedHeight) updatedY = (Math.max(currentScreen.top, currentScreen.allowedHeight - currentH) - basePosition.y)+'px'; - style.marginLeft = updatedX; - style.marginTop = updatedY; + this.setTooltipPosition(updatedX, updatedY, currentScreen); log(' => expanded dimensions: ', { x : updatedX, y : updatedY