Skip to content
Snippets Groups Projects
Commit 56fc8373 authored by chris's avatar chris
Browse files

add overlay

parent bdbea69d
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,10 @@ const captionPlugin = key =>
if (figCap[6] && figCap[6].type.name === 'figcaption') {
const figCapEl = document.getElementById(figCap[6].attrs.id);
if (figCapEl.parentElement.firstChild.tagName === 'FIGCAPTION') {
if (
figCapEl &&
figCapEl.parentElement.firstChild.tagName === 'FIGCAPTION'
) {
figCapEl.parentElement.remove();
}
}
......
......@@ -6,7 +6,7 @@ import { StepMap } from 'prosemirror-transform';
import { keymap } from 'prosemirror-keymap';
import { baseKeymap } from 'prosemirror-commands';
import { undo, redo } from 'prosemirror-history';
import { WaxContext } from 'wax-prosemirror-core';
import { WaxContext, ComponentPlugin } from 'wax-prosemirror-core';
import Placeholder from '../plugins/placeholder';
import FakeCursorPlugin from '../../MultipleDropDownService/plugins/FakeCursorPlugin';
......@@ -50,6 +50,7 @@ const EditorWrapper = styled.div`
}
}
`;
let WaxOverlays = () => true;
const EditorComponent = ({ node, view, getPos }) => {
const editorRef = useRef();
......@@ -96,6 +97,7 @@ const EditorComponent = ({ node, view, getPos }) => {
]);
useEffect(() => {
WaxOverlays = ComponentPlugin('waxOverlays');
questionView = new EditorView(
{
mount: editorRef.current,
......@@ -176,6 +178,7 @@ const EditorComponent = ({ node, view, getPos }) => {
return (
<EditorWrapper>
<div ref={editorRef} />
<WaxOverlays activeViewId={questionId} />
</EditorWrapper>
);
};
......
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