This commit is contained in:
Ross
2021-08-20 10:26:58 +01:00
parent ad3094851d
commit 01c98cd2e1
12 changed files with 176 additions and 97 deletions
+15
View File
@@ -7,6 +7,21 @@ const $$ = {
}
});
},
onPanelRender(root, panelId, fn) {
/*
This is a helper function to attach a handler for a `djdt.panel.render`
event of a specific panel.
root: The container element that the listener should be attached to.
panelId: The Id of the panel.
fn: A function to execute when the event is triggered.
*/
root.addEventListener("djdt.panel.render", function (event) {
if (event.detail.panelId === panelId) {
fn.call(event);
}
});
},
show(element) {
element.classList.remove("djdt-hidden");
},