Skip to content
Snippets Groups Projects
Commit f2bfc25d authored by Alexandros Georgantas's avatar Alexandros Georgantas Committed by Yannis Barlas
Browse files

Correct postioning of the comment bubble

parent 6e988031
No related branches found
No related tags found
No related merge requests found
......@@ -59,19 +59,13 @@ class CommentBubble extends Tool {
const overlayContainerLeft = overlayContainer.offsetLeft
const left = documentElementWidth - overlayContainerLeft - 15
// const selection = this.getSelection()
// const container = surface.getContainer()
// const position = container.getPosition(surface.getDocument().get(selection.getNodeId()))
// unhide it first, as the bubble has no height otherwise
this.el.removeClass('sc-overlay-bubble-hidden')
// TODO getBoundingRectangleForSelection() doesn't exist anymore
// const hints = surface.getBoundingRectangleForSelection()
// const selectionHeight = hints.height
const selectionHeight = 20
let wsel = window.getSelection()
let wrange = wsel.getRangeAt(0)
const hints = wrange.getBoundingClientRect()
const selectionHeight = hints.height
const bubbleHeight = this.el.getHeight()
const cheat = 3
const moveUp = (selectionHeight / 2) + (bubbleHeight / 2) + cheat
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment