From 3c6b5d190cff90eca66df789305d2ccbac5cd865 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Fri, 5 Sep 2014 03:29:55 +0200 Subject: [PATCH] Fix QuickView popover being in the wrong pane --- src/extensions/default/QuickView/main.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 62f959fdc07..47562a92771 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -110,18 +110,17 @@ define(function (require, exports, module) { popoverState = null; } - function positionPreview(xpos, ypos, ybot) { + function positionPreview(editor, xpos, ypos, ybot) { var previewWidth = $previewContainer.outerWidth(), top = ypos - $previewContainer.outerHeight() - POINTER_HEIGHT, left = xpos - previewWidth / 2, - $editorHolder = $("#editor-holder"), elementRect = { top: top, left: left - POPOVER_HORZ_MARGIN, height: $previewContainer.outerHeight() + POINTER_HEIGHT, width: previewWidth + 2 * POPOVER_HORZ_MARGIN }, - clip = ViewUtils.getElementClipSize($editorHolder, elementRect); + clip = ViewUtils.getElementClipSize($(editor.getRootElement()), elementRect); // Prevent horizontal clipping if (clip.left > 0) { @@ -489,7 +488,7 @@ define(function (require, exports, module) { "" ); $previewContainer.show(); - positionPreview(popoverState.xpos, popoverState.ytop, popoverState.ybot); + positionPreview(editor, popoverState.xpos, popoverState.ytop, popoverState.ybot); }); }; @@ -622,7 +621,7 @@ define(function (require, exports, module) { if (popoverState.onShow) { popoverState.onShow(); } else { - positionPreview(popoverState.xpos, popoverState.ytop, popoverState.ybot); + positionPreview(editor, popoverState.xpos, popoverState.ytop, popoverState.ybot); } } }