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

fix activeView

parent d8b2ef41
No related branches found
No related tags found
1 merge request!359new node structure
......@@ -5,12 +5,12 @@ import MenuButton from '../ui/buttons/MenuButton';
const Button = ({ view = {}, item }) => {
const { active, icon, label, run, select, title } = item;
const context = useContext(WaxContext);
const {
view: { main },
activeViewId,
activeView,
} = useContext(WaxContext);
} = context;
const isEditable = main.props.editable(editable => {
return editable;
......@@ -44,7 +44,7 @@ const Button = ({ view = {}, item }) => {
title={title}
/>
),
[isActive, isDisabled],
[isActive, isDisabled, activeViewId],
);
return MenuButtonComponent;
......
......@@ -93,7 +93,7 @@ const ImageUpload = ({ item, fileUpload, view }) => {
</label>
</Wrapper>
),
[isDisabled],
[isDisabled, activeViewId],
);
return ImageUploadComponent;
......
......@@ -96,10 +96,10 @@ class EssayQuestion extends Tools {
tr.replaceSelectionWith(essayAnswer);
dispatch(tr);
// setTimeout(() => {
// createEmptyParagraph(context, essayQuestion.attrs.id);
// createEmptyParagraph(context, essayAnswer.attrs.id);
// }, 50);
setTimeout(() => {
createEmptyParagraph(context, essayAnswer.attrs.id);
createEmptyParagraph(context, essayQuestion.attrs.id);
}, 50);
};
}
......
......@@ -15,7 +15,7 @@ import {
liftListItem,
sinkListItem,
} from 'prosemirror-schema-list';
import Placeholder from '../plugins/placeholder';
import Placeholder from '../../MultipleChoiceQuestionService/plugins/placeholder';
const EditorWrapper = styled.div`
border: none;
......
......@@ -15,7 +15,7 @@ import {
liftListItem,
sinkListItem,
} from 'prosemirror-schema-list';
import Placeholder from '../plugins/placeholder';
import Placeholder from '../../MultipleChoiceQuestionService/plugins/placeholder';
const EditorWrapper = styled.div`
border: none;
......@@ -150,6 +150,9 @@ const EssayQuestionComponent = ({ node, view, getPos }) => {
if (essayQuestionView.hasFocus()) essayQuestionView.focus();
},
},
handleClickOn: () => {
context.updateView({}, questionId);
},
attributes: {
spellcheck: 'false',
......
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