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

SmallCaps Service

parent f5ad0de6
No related branches found
No related tags found
1 merge request!45Develop
import { toggleMark } from "prosemirror-commands";
import { markActive } from "../../lib/Utils";
import Tools from "../../lib/Tools";
import { injectable } from "inversify";
import { icons } from "wax-prosemirror-components";
@injectable()
export default class SmallCaps extends Tools {
title = "Toggle Small Caps";
content = icons.small_caps;
get run() {
return (state, dispatch) => {
toggleMark(state.config.schema.marks.smallcaps)(state, dispatch);
};
}
get active() {
return state => {
return markActive(state.config.schema.marks.smallcaps)(state);
};
}
}
import Service from "wax-prosemirror-core/src/services/Service";
import { smallcapsMark } from "wax-prosemirror-schema";
import SmallCaps from "./SmallCaps";
class SmallCapsService extends Service {
register() {
this.container.bind("SmallCaps").to(SmallCaps);
this.container
.bind("schema")
.toConstantValue({
smallcaps: smallcapsMark
})
.whenTargetNamed("mark");
}
}
export default SmallCapsService;
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