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

default nodeView

parent 26c87c19
No related branches found
No related tags found
1 merge request!313Fill the gap
......@@ -25,7 +25,7 @@ const Hhmi = () => {
value=""
// readonly
layout={HhmiLayout}
onChange={source => console.log(source)}
// onChange={source => console.log(source)}
/>
</>
);
......
......@@ -26,25 +26,6 @@ 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]) {
const { state } = this.context.view[node.attrs.id];
const start = node.content.findDiffStart(state.doc.content);
if (start != null) {
let { a: endA, b: endB } = node.content.findDiffEnd(state.doc.content);
const overlap = start - Math.min(endA, endB);
if (overlap > 0) {
endA += overlap;
endB += overlap;
}
this.context.view[node.attrs.id].dispatch(
state.tr
.replace(start, endB, node.slice(start, endA))
.setMeta('fromOutside', true),
);
}
}
return true;
}
......@@ -63,7 +44,11 @@ export default class AbstractNodeView {
return true;
}
selectNode() {}
selectNode() {
return true;
}
deselectNode() {}
deselectNode() {
return true;
}
}
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