Switch from attribute+observer to bubbling events for comms

This commit is contained in:
Ian Gulliver
2019-07-16 16:05:29 +00:00
parent 329727ff9e
commit ccf4299d5a
3 changed files with 25 additions and 14 deletions

View File

@@ -41,7 +41,7 @@ class EditorInputBase extends EditorEntryBase {
}
onInput() {
this.elem_.setAttribute('data-arch-render', '');
this.requestRender();
let objs = document.getElementsByClassName('grid-' + this.getId());
if (objs.length == 1) {
objs[0].innerText = this.getLabel();
@@ -52,7 +52,8 @@ class EditorInputBase extends EditorEntryBase {
onBlur() {
if (this.getLabel() != this.lastSnapshotLabel_) {
this.lastSnapshotLabel_ = this.getLabel();
this.elem_.setAttribute('data-arch-snapshot', '');
this.elem_.dispatchEvent(
new CustomEvent('snapshotRequest', { bubbles: true }));
}
}