From 3e4df9534f3f413a49bd7c91b59a6dbcd391886d Mon Sep 17 00:00:00 2001 From: jotaen4tinypilot <83721279+jotaen4tinypilot@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:06:12 +0200 Subject: [PATCH] Dispatch DialogClosed event when clicking X button (#1828) Related https://github.com/tiny-pilot/tinypilot/issues/1814. Stacked on https://github.com/tiny-pilot/tinypilot/pull/1827. This PR changes the control flow when clicking the `X` button in the ``: instead of hiding the panel directly, it now dispatches a `dialog-closed` event into the slotted element, to give the slotted element a chance to hook into this event and react to it. We need this in [a subsequent PR (the network status dialog)](https://github.com/tiny-pilot/tinypilot/pull/1829), which needs to stop its internal update loop once the dialog terminates. This also must work if the user clicks the `X` button, not just when using the `Close` one. Review
on CodeApprove --------- Co-authored-by: Jan Heuermann --- .../custom-elements/overlay-panel.html | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/templates/custom-elements/overlay-panel.html b/app/templates/custom-elements/overlay-panel.html index 115c63d12..d6f6a3d69 100644 --- a/app/templates/custom-elements/overlay-panel.html +++ b/app/templates/custom-elements/overlay-panel.html @@ -61,11 +61,13 @@ /> - +