diff --git a/app/components/SimpleEditor/elements/comment/CommentBubble.js b/app/components/SimpleEditor/elements/comment/CommentBubble.js index 5c79d60fd28b04a05adbc54dc4042ac789d60591..1fcec919ea63a1d672168104199a73cf1639c28e 100644 --- a/app/components/SimpleEditor/elements/comment/CommentBubble.js +++ b/app/components/SimpleEditor/elements/comment/CommentBubble.js @@ -51,13 +51,22 @@ class CommentBubble extends Tool { const surface = this.getSurface() if (!surface) return - const documentElement = document.querySelector('.se-content') - const overlayContainer = document.querySelector('.sc-overlay') - setTimeout(() => { // read comment below + let documentElement = document.querySelector('.se-content') + let overlayContainer = document.querySelector('.sc-overlay') + let fix = 15 + if (parseInt(overlayContainer.offsetLeft) === 0) { + const minEditorContentPanelChildren = document.getElementById('mini-editor-content-panel').children + const temp = minEditorContentPanelChildren[0].children + documentElement = temp[0] + const children = temp[0].children + overlayContainer = children[1] + fix = 357 + } + console.log(fix) const documentElementWidth = documentElement.offsetWidth const overlayContainerLeft = overlayContainer.offsetLeft - const left = documentElementWidth - overlayContainerLeft - 15 + const left = documentElementWidth - overlayContainerLeft - fix // unhide it first, as the bubble has no height otherwise this.el.removeClass('sc-overlay-bubble-hidden') @@ -70,7 +79,7 @@ class CommentBubble extends Tool { const cheat = 3 const moveUp = (selectionHeight / 2) + (bubbleHeight / 2) + cheat const top = '-' + moveUp + 'px' - + console.log('left', left) this.el.css('left', left) this.el.css('top', top) })