Group nested message handlers together

This commit is contained in:
toasted-nutbread 2019-12-15 17:01:29 -05:00
parent 88ac8f4ead
commit 3f8cc83c25

View File

@ -65,10 +65,6 @@ class PopupProxyHost {
return popup; return popup;
} }
async createNestedPopup(parentId) {
return this.createPopup(parentId, 0).id;
}
getPopup(id) { getPopup(id) {
const popup = this.popups.get(id); const popup = this.popups.get(id);
if (typeof popup === 'undefined') { if (typeof popup === 'undefined') {
@ -88,6 +84,12 @@ class PopupProxyHost {
return new DOMRect(x, y, jsonRect.width, jsonRect.height); return new DOMRect(x, y, jsonRect.width, jsonRect.height);
} }
// Message handlers
async createNestedPopup(parentId) {
return this.createPopup(parentId, 0).id;
}
async setOptions(id, options) { async setOptions(id, options) {
const popup = this.getPopup(id); const popup = this.getPopup(id);
return await popup.setOptions(options); return await popup.setOptions(options);