Switch from attribute+observer to bubbling events for comms
This commit is contained in:
@@ -54,7 +54,8 @@ class EditorEntryBase extends ListenUtils {
|
||||
elem.classList.toggle('highlight', highlight);
|
||||
}
|
||||
// Do NOT refresh: this bypasses the rendering pipeline
|
||||
this.elem_.setAttribute('data-arch-snapshot', '');
|
||||
this.elem_.dispatchEvent(
|
||||
new CustomEvent('snapshotRequest', { bubbles: true }));
|
||||
}
|
||||
|
||||
toggleHighlight() {
|
||||
@@ -78,6 +79,11 @@ class EditorEntryBase extends ListenUtils {
|
||||
afterDomAdd() {
|
||||
}
|
||||
|
||||
requestRender() {
|
||||
this.elem_.dispatchEvent(
|
||||
new CustomEvent('renderRequest', { bubbles: true }));
|
||||
}
|
||||
|
||||
static addBefore(container, elem, ...rest) {
|
||||
let entry = new this(null, ...rest);
|
||||
container.insertBefore(entry.getElement(), elem);
|
||||
|
||||
Reference in New Issue
Block a user