Skip to content

Commit f2edc30

Browse files
authored
api.js -- revert and use event instead
1 parent fcd0f6b commit f2edc30

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/addons/api.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -660,15 +660,21 @@ class Tab extends EventTargetShim {
660660
}
661661

662662
createModal (title, {isOpen = false} = {}) {
663-
return modal.createEditorModal(this, title, {isOpen});
663+
const modal = modal.createEditorModal(this, title, {isOpen});
664+
this.traps.vm.emit("ADDON_WORKER_MODAL", modal);
665+
return modal;
664666
}
665667

666668
confirm (...args) {
667-
return modal.confirm(this, ...args);
669+
const modal = modal.confirm(this, ...args);
670+
this.traps.vm.emit("ADDON_WORKER_MODAL", modal);
671+
return modal;
668672
}
669673

670674
prompt (...args) {
671-
return modal.prompt(this, ...args);
675+
const modal = modal.prompt(this, ...args);
676+
this.traps.vm.emit("ADDON_WORKER_MODAL", modal);
677+
return modal;
672678
}
673679
}
674680

@@ -714,8 +720,7 @@ class AddonRunner {
714720
addon: {
715721
tab: new Tab(id),
716722
settings: new Settings(id, manifest),
717-
self: new Self(id, this.getResource.bind(this)),
718-
tabClass: id === "editor-animations" ? Tab : "access denied"
723+
self: new Self(id, this.getResource.bind(this))
719724
},
720725
msg: this.msg.bind(this),
721726
safeMsg: this.safeMsg.bind(this)

0 commit comments

Comments
 (0)