Skip to content
Snippets Groups Projects
Commit 7e5b9b0d authored by chris's avatar chris
Browse files

correct top for comment boxes

parent df0564ff
No related branches found
No related tags found
1 merge request!257Editoria fixes
import React, { useLayoutEffect, useState, useMemo } from 'react';
import { createGlobalStyle } from 'styled-components';
import styled, { createGlobalStyle } from 'styled-components';
import { Wax } from 'wax-prosemirror-core';
......@@ -56,6 +56,7 @@ const Editoria = () => {
() => (
<>
<GlobalStyle />
<div>Hello</div>
<Wax
key={key}
config={finalConfig}
......
......@@ -248,7 +248,7 @@ const EditoriaLayout = ({ editor }) => {
return (
<ThemeProvider theme={cokoTheme}>
<Wrapper style={fullScreenStyles}>
<Wrapper style={fullScreenStyles} id="wax-container">
<TopMenu>
<MainMenuToolBar />
</TopMenu>
......
......@@ -58,15 +58,24 @@ export default ({ area }) => {
annotationTop =
markNodeEl.getBoundingClientRect().top - WaxSurface.top;
} else {
// Notes
panelWrapper = document.getElementsByClassName('panelWrapper');
panelWrapperHeight = panelWrapper[0].getBoundingClientRect().height;
markNodeEl = document
.querySelector('#notes-container')
.querySelector(`[data-id="${id}"]`);
if (markNodeEl)
if (markNodeEl) {
const WaxContainerTop = document
.querySelector('#wax-container')
.getBoundingClientRect().top;
annotationTop =
markNodeEl.getBoundingClientRect().top - panelWrapperHeight - 50;
markNodeEl.getBoundingClientRect().top -
panelWrapperHeight -
WaxContainerTop -
50;
}
}
let boxEl = null;
......
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