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

render wrapper element for inline

parent 6ab7e7db
No related branches found
No related tags found
1 merge request!313Fill the gap
......@@ -54,7 +54,7 @@ const Editors = () => {
case 'ncbi':
break;
default:
return <Editoria />;
return <HHMI />;
}
};
......
import { injectable, inject } from 'inversify';
import { ToolGroup } from 'wax-prosemirror-services';
@injectable()
class FillTheGap extends ToolGroup {
tools = [];
constructor(@inject('FillTheGapQuestion') FillTheGapQuestion) {
super();
this.tools = [FillTheGapQuestion];
}
}
export default FillTheGap;
import { Service } from 'wax-prosemirror-services';
import FillTheGap from './FillTheGap';
class FillTheGapToolGroupService extends Service {
register() {
this.container.bind('FillTheGap').to(FillTheGap);
}
}
export default FillTheGapToolGroupService;
......@@ -2,8 +2,6 @@ import { Service } from 'wax-prosemirror-services';
import Questions from './Questions';
class QuestionsToolGroupService extends Service {
boot() {}
register() {
this.container.bind('Questions').to(Questions);
}
......
......@@ -11,7 +11,9 @@ export default class AbstractNodeView {
Component,
context,
) {
this.dom = document.createElement('div');
this.dom = node.type.spec.inline
? document.createElement('span')
: document.createElement('div');
this.dom.id = uuidv4();
this.dom.classList.add('portal');
this.node = node;
......@@ -23,6 +25,7 @@ export default class AbstractNodeView {
}
update(node) {
if (node.type !== this.node.type) return false;
if (!node.sameMarkup(this.node)) return false;
this.node = node;
if (this.context.view[node.attrs.id]) {
......@@ -59,4 +62,8 @@ export default class AbstractNodeView {
ignoreMutation() {
return true;
}
selectNode() {}
deselectNode() {}
}
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