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

layout fix + question creation

parent 25963258
No related branches found
No related tags found
1 merge request!376layout fix + question creation
...@@ -60,12 +60,14 @@ const EditorArea = styled.div` ...@@ -60,12 +60,14 @@ const EditorArea = styled.div`
`; `;
const WaxSurfaceScroll = styled.div` const WaxSurfaceScroll = styled.div`
padding: 25px 25% 0 25%;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
padding: 25px 25% 0 25%; position: relative;
width: 100%; width: 100%;
/* PM styles for main content*/ /* PM styles for main content*/
${EditorElements}; ${EditorElements};
`; `;
...@@ -73,6 +75,7 @@ const WaxSurfaceScroll = styled.div` ...@@ -73,6 +75,7 @@ const WaxSurfaceScroll = styled.div`
const EditorContainer = styled.div` const EditorContainer = styled.div`
height: 100%; height: 100%;
width: 100%; width: 100%;
position: relative;
.ProseMirror { .ProseMirror {
box-shadow: 0 0 8px #ecedf1; box-shadow: 0 0 8px #ecedf1;
......
...@@ -7,6 +7,7 @@ import { DocumentHelpers } from 'wax-prosemirror-utilities'; ...@@ -7,6 +7,7 @@ import { DocumentHelpers } from 'wax-prosemirror-utilities';
const Wrapper = styled.div` const Wrapper = styled.div`
background: #fff; background: #fff;
display: flex;
border-radius: 1.03093% / 8%; border-radius: 1.03093% / 8%;
box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px 0px, box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px 0px,
rgba(9, 30, 66, 0.31) 0px 0px 1px 0px; rgba(9, 30, 66, 0.31) 0px 0px 1px 0px;
...@@ -38,7 +39,7 @@ const Input = styled.input` ...@@ -38,7 +39,7 @@ const Input = styled.input`
`; `;
const ButtonGroup = styled.div` const ButtonGroup = styled.div`
display: inline-block; display: flex;
`; `;
const StyledButton = styled.button` const StyledButton = styled.button`
......
...@@ -143,14 +143,6 @@ img.ProseMirror-separator { ...@@ -143,14 +143,6 @@ img.ProseMirror-separator {
/* -- Selection Plugin ---------------------------------- */ /* -- Selection Plugin ---------------------------------- */
p::selection,
p > *::selection {
background-color: #c0c0c0;
}
.katex-html *::selection {
background-color: none !important;
}
.math-node.math-select .math-render { .math-node.math-select .math-render {
background-color: #c0c0c0ff; background-color: #c0c0c0ff;
} }
......
...@@ -27,6 +27,14 @@ const EditorWrapper = styled.div` ...@@ -27,6 +27,14 @@ const EditorWrapper = styled.div`
outline: none; outline: none;
} }
:empty::before {
content: 'Type your answer';
color: #aaa;
float: left;
font-style: italic;
pointer-events: none;
}
p.empty-node:first-child::before { p.empty-node:first-child::before {
content: attr(data-content); content: attr(data-content);
} }
......
...@@ -32,6 +32,14 @@ const EditorWrapper = styled.div` ...@@ -32,6 +32,14 @@ const EditorWrapper = styled.div`
outline: none; outline: none;
} }
:empty::before {
content: 'Type your question';
color: #aaa;
float: left;
font-style: italic;
pointer-events: none;
}
p.empty-node:first-child::before { p.empty-node:first-child::before {
content: attr(data-content); content: attr(data-content);
} }
......
...@@ -79,11 +79,11 @@ const createOptions = (main, context, parentType, questionType, answerType) => { ...@@ -79,11 +79,11 @@ const createOptions = (main, context, parentType, questionType, answerType) => {
tr.replaceSelectionWith(secondOption); tr.replaceSelectionWith(secondOption);
dispatch(tr); dispatch(tr);
setTimeout(() => { // setTimeout(() => {
createEmptyParagraph(context, firstOption.attrs.id); // createEmptyParagraph(context, firstOption.attrs.id);
createEmptyParagraph(context, secondOption.attrs.id); // createEmptyParagraph(context, secondOption.attrs.id);
createEmptyParagraph(context, question.attrs.id); // createEmptyParagraph(context, question.attrs.id);
}, 50); // }, 50);
return true; return 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