Bypass the rendering pipeline for highlighting to reduce (eliminate) latency

Fixes #15
This commit is contained in:
Ian Gulliver
2019-07-14 02:26:00 +00:00
parent a4630ba92a
commit f3823812c7
18 changed files with 96 additions and 123 deletions

View File

@@ -26,14 +26,12 @@ class EditorLink extends EditorEntryBase {
}
serialize() {
return {
return super.serialize({
type: 'link',
id: this.getId(),
label: this.getLabel(),
from: this.getFrom().serialize(),
to: this.getTo().serialize(),
highlight: this.elem_.classList.contains('highlight'),
};
});
}
getFrom() {
@@ -59,10 +57,6 @@ class EditorLink extends EditorEntryBase {
}
}
setHighlight(highlight) {
this.elem_.classList.toggle('highlight', highlight);
}
flip() {
let entries = this.nodes_.getEntries(EditorNode);
let fromElem = entries[0].getElement();
@@ -91,14 +85,6 @@ class EditorLink extends EditorEntryBase {
e.preventDefault();
break;
case ' ':
this.elem_.classList.toggle('highlight');
this.elem_.setAttribute('data-arch-refresh', '');
this.elem_.setAttribute('data-arch-snapshot', '');
e.stopPropagation();
e.preventDefault();
break;
case 'f':
this.flip();
e.stopPropagation();