From 4186a6c18c998f936a2c09c02cee9ed65dbc1e32 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Fri, 6 Aug 2021 14:14:58 +0300 Subject: [PATCH] dissalow images --- .../components/EditorComponent.js | 4 ++-- editors/demo/src/HHMI/layout/EditorElements.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editors/demo/src/HHMI/MultipleChoiceQuestionService/components/EditorComponent.js b/editors/demo/src/HHMI/MultipleChoiceQuestionService/components/EditorComponent.js index 0cd32b264..ce3a4f1e3 100644 --- a/editors/demo/src/HHMI/MultipleChoiceQuestionService/components/EditorComponent.js +++ b/editors/demo/src/HHMI/MultipleChoiceQuestionService/components/EditorComponent.js @@ -102,10 +102,9 @@ const EditorComponent = ({ node, view, getPos }) => { }), // This is the magic part dispatchTransaction, - disallowedTools: [], + disallowedTools: ['images'], handleDOMEvents: { mousedown: () => { - context.updateView({}, questionId); context.view[activeViewId].dispatch( context.view[activeViewId].state.tr.setSelection( TextSelection.between( @@ -114,6 +113,7 @@ const EditorComponent = ({ node, view, getPos }) => { ), ), ); + context.updateView({}, questionId); // Kludge to prevent issues due to the fact that the whole // footnote is node-selected (and thus DOM-selected) when // the parent editor is focused. diff --git a/editors/demo/src/HHMI/layout/EditorElements.js b/editors/demo/src/HHMI/layout/EditorElements.js index a75f747ae..f3f4a0734 100644 --- a/editors/demo/src/HHMI/layout/EditorElements.js +++ b/editors/demo/src/HHMI/layout/EditorElements.js @@ -96,8 +96,8 @@ export default css` } } - .question { - border: 1px solid green; + .mutiple-choice { + border: 3px solid #f5f5f7; counter-reset: question-item-multiple; margin: 38px; padding: 20px; -- GitLab