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

temp fix for injecting schema

parent 247d7654
No related branches found
No related tags found
1 merge request!314temp fix for injecting schema
import Service from "../../Service";
import { toggleMark } from "prosemirror-commands";
import { underlineMark } from "wax-prosemirror-schema";
import Underline from "./Underline";
import { toggleMark } from 'prosemirror-commands';
import { underlineMark } from 'wax-prosemirror-schema';
import Underline from './Underline';
import Service from '../../Service';
class UnderlineService extends Service {
boot() {
const shortCuts = this.container.get("ShortCuts");
shortCuts.addShortCut({ "Mod-u": toggleMark(this.schema.marks.underline) });
const shortCuts = this.container.get('ShortCuts');
shortCuts.addShortCut({ 'Mod-u': toggleMark(this.schema.marks.underline) });
}
register() {
this.container.bind("Underline").to(Underline);
const createMark = this.container.get("CreateMark");
this.container.bind('Underline').to(Underline);
const createMark = this.container.get('CreateMark');
createMark(
{
underline: underlineMark
underline: underlineMark,
},
{ toWaxSchema: true }
{ toWaxSchema: true },
);
}
}
......
......@@ -16,10 +16,11 @@ export default class ShortCutsService extends Service {
.bind('ShortCuts')
.toDynamicValue(() => {
if (this.app.schema) {
return new ShortCuts(
PmPlugins,
this.container.get('Schema').getSchema(),
);
const {
schema: { schema },
} = this.app;
return new ShortCuts(PmPlugins, schema);
}
return new ShortCuts(
......
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