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

revert styles and add content to node

parent 3a4fea91
No related branches found
No related tags found
No related merge requests found
Pipeline #57309 passed with stages
in 24 minutes and 55 seconds
...@@ -15,7 +15,7 @@ import { WaxContext, ComponentPlugin } from 'wax-prosemirror-core'; ...@@ -15,7 +15,7 @@ import { WaxContext, ComponentPlugin } from 'wax-prosemirror-core';
import FakeCursorPlugin from '../plugins/FakeCursorPlugin'; import FakeCursorPlugin from '../plugins/FakeCursorPlugin';
const EditorWrapper = styled.div` const EditorWrapper = styled.div`
// position: relative; position: relative;
height: 100%; height: 100%;
> .ProseMirror { > .ProseMirror {
......
...@@ -119,13 +119,14 @@ export default ({ setPosition, position }) => { ...@@ -119,13 +119,14 @@ export default ({ setPosition, position }) => {
const { from } = selection; const { from } = selection;
const WaxSurface = activeView.dom.getBoundingClientRect(); const WaxSurface = activeView.dom.getBoundingClientRect();
const start = activeView.coordsAtPos(from); const start = activeView.coordsAtPos(from);
console.log(start, WaxSurface.top);
const left = start.left - WaxSurface.left - 75; const left = start.left - WaxSurface.left - 75;
const top = start.top - WaxSurface.top + 25; const top = start.top - WaxSurface.top + 25;
setPosition({ ...position, left, top }); setPosition({ ...position, left, top });
}, [position.left]); }, [position.left]);
useEffect(() => { useEffect(() => {
// if (addOptionRef.current) addOptionRef.current.focus(); if (addOptionRef.current) addOptionRef.current.focus();
if (!activeView.state.selection.node) return; if (!activeView.state.selection.node) return;
const { tr } = activeView.state; const { tr } = activeView.state;
...@@ -163,7 +164,7 @@ export default ({ setPosition, position }) => { ...@@ -163,7 +164,7 @@ export default ({ setPosition, position }) => {
const obj = { label: addOptionRef.current.value, value: uuidv4() }; const obj = { label: addOptionRef.current.value, value: uuidv4() };
setOptions(prevOptions => [...prevOptions, obj]); setOptions(prevOptions => [...prevOptions, obj]);
setOptionText(''); setOptionText('');
// addOptionRef.current.focus(); addOptionRef.current.focus();
}; };
const removeOption = id => { const removeOption = id => {
......
...@@ -14,7 +14,6 @@ const activeStylesSvg = css` ...@@ -14,7 +14,6 @@ const activeStylesSvg = css`
`; `;
const StyledIconActionContainer = styled.div` const StyledIconActionContainer = styled.div`
font-variant-numeric: lining-nums proportional-nums;
display: inline-block; display: inline-block;
height: 24px; height: 24px;
width: 24px; width: 24px;
...@@ -24,7 +23,6 @@ const StyledIconActionContainer = styled.div` ...@@ -24,7 +23,6 @@ const StyledIconActionContainer = styled.div`
const StyledIconAction = styled(Icon)` const StyledIconAction = styled(Icon)`
${props => props.isActive && activeStylesSvg} ${props => props.isActive && activeStylesSvg}
display: inline-block;
`; `;
const AnswerContainer = styled.div` const AnswerContainer = styled.div`
...@@ -69,8 +67,7 @@ export default ({ node, getPos }) => { ...@@ -69,8 +67,7 @@ export default ({ node, getPos }) => {
if (!readOnly) { if (!readOnly) {
return ( return (
<StyledIconActionContainer isActive={isActive}> <StyledIconActionContainer isActive={isActive}>
1 <StyledIconAction isActive={isActive} name="mulitpleDropDown" />
{/* <StyledIconAction isActive={isActive} name="mulitpleDropDown" /> */}
</StyledIconActionContainer> </StyledIconActionContainer>
); );
} }
......
...@@ -6,6 +6,7 @@ const multipleDropDownOptionNode = { ...@@ -6,6 +6,7 @@ const multipleDropDownOptionNode = {
correct: { default: '' }, correct: { default: '' },
answer: { default: '' }, answer: { default: '' },
}, },
content: 'inline*',
group: 'inline questions', group: 'inline questions',
inline: true, inline: true,
atom: true, atom: true,
......
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