Skip to content
Snippets Groups Projects
Commit 373dfb91 authored by Christos's avatar Christos
Browse files

Merge branch 'fix-shortcuts' into 'master'

temp fix for injecting schema

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