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

expiremental filter transaction

parent b61059b7
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,16 @@ import MultipleChoiceSingleCorrectQuestionService from './MultipleChoiceSingleCo
import TrueFalseQuestionService from './TrueFalseQuestionService/TrueFalseQuestionService';
import TrueFalseSingleCorrectQuestionService from './TrueFalseSingleCorrectQuestionService/TrueFalseSingleCorrectQuestionService';
import './multipleQuestionStyles.css';
import MoveCursorPlugin from './plugins/MoveCursorPlugin';
class MultipleChoiceQuestionService extends Service {
boot() {
this.app.PmPlugins.add(
'moveCursorPlugin',
MoveCursorPlugin('moveCursorPlugin'),
);
}
register() {
this.container.bind('MultipleChoiceQuestion').to(MultipleChoiceQuestion);
const createNode = this.container.get('CreateNode');
......
import { Plugin, PluginKey } from 'prosemirror-state';
const testPlugin = new PluginKey('moveCursorPlugin');
export default () => {
return new Plugin({
key: testPlugin,
filterTransaction: (transaction, state) => {
// if (
// transaction.getMeta('fromOutside') &&
// transaction.doc &&
// transaction.doc.type &&
// transaction.doc.type.name === 'multiple_drop_down_container'
// ) {
// return false;
// }
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