Bypass the rendering pipeline for highlighting to reduce (eliminate) latency
Fixes #15
This commit is contained in:
@@ -9,14 +9,9 @@ class EditorNode extends EditorInputBase {
|
||||
serialize() {
|
||||
return super.serialize({
|
||||
type: 'node',
|
||||
highlight: this.elem_.classList.contains('highlight'),
|
||||
});
|
||||
}
|
||||
|
||||
setHighlight(highlight) {
|
||||
this.elem_.classList.toggle('highlight', highlight);
|
||||
}
|
||||
|
||||
isSoft() {
|
||||
// Nested nodes are presumed to be references to other nodes if they exist
|
||||
for (let iter = this.elem_.parentElement; iter; iter = iter.parentElement) {
|
||||
@@ -27,20 +22,6 @@ class EditorNode extends EditorInputBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
onKeyDown(e) {
|
||||
super.onKeyDown(e);
|
||||
|
||||
switch (e.key) {
|
||||
case ' ':
|
||||
this.elem_.classList.toggle('highlight');
|
||||
this.elem_.setAttribute('data-arch-snapshot', '');
|
||||
this.onInput();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static unserialize(ser) {
|
||||
let node = new EditorNode(ser.id);
|
||||
node.setLabel(ser.label);
|
||||
|
||||
Reference in New Issue
Block a user