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

use pm command for codeblock

parent 25793f92
No related branches found
No related tags found
1 merge request!143Track changes
import { injectable } from 'inversify'; import { injectable } from 'inversify';
import { icons } from 'wax-prosemirror-components'; import { icons } from 'wax-prosemirror-components';
import { Commands } from 'wax-prosemirror-utilities'; import { setBlockType } from 'prosemirror-commands';
import Tools from '../lib/Tools'; import Tools from '../lib/Tools';
@injectable() @injectable()
...@@ -10,16 +10,13 @@ class CodeBlockTool extends Tools { ...@@ -10,16 +10,13 @@ class CodeBlockTool extends Tools {
get run() { get run() {
return (state, dispatch) => { return (state, dispatch) => {
Commands.setBlockType(state.config.schema.nodes.code_block)( setBlockType(state.config.schema.nodes.code_block)(state, dispatch);
state,
dispatch,
);
}; };
} }
get enable() { get enable() {
return state => { return state => {
return Commands.setBlockType(state.config.schema.nodes.code_block)(state); return setBlockType(state.config.schema.nodes.code_block)(state);
}; };
} }
} }
......
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