From 854b0b97fdb2c8adb6f56ad0b776b5e8dacbb47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Tue, 17 Dec 2024 17:18:07 +0100 Subject: [PATCH] jsdialog: allow to close popover in sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if id is "0" it is still valid Signed-off-by: Szymon Kłos Change-Id: I52b5e69abfbf287d103fe5302c61ccbc33cfe2c6 --- browser/src/control/Control.JSDialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/src/control/Control.JSDialog.js b/browser/src/control/Control.JSDialog.js index 57c71528dfbe..1aef68e317fd 100644 --- a/browser/src/control/Control.JSDialog.js +++ b/browser/src/control/Control.JSDialog.js @@ -75,7 +75,7 @@ L.Control.JSDialog = L.Control.extend({ }, close: function(id, sendCloseEvent) { - if (id && this.dialogs[id]) { + if (id !== undefined && this.dialogs[id]) { if (!sendCloseEvent && this.dialogs[id].overlay && !this.dialogs[id].isSubmenu) L.DomUtil.remove(this.dialogs[id].overlay); @@ -110,7 +110,7 @@ L.Control.JSDialog = L.Control.extend({ }, closeDialog: function(id, sendCloseEvent) { - if (!id || !this.dialogs[id]) { + if (id === undefined || !this.dialogs[id]) { console.warn('missing dialog data'); return; } @@ -125,7 +125,7 @@ L.Control.JSDialog = L.Control.extend({ // sendCloseEvent means that we only send a command to the server // we want to kill HTML popup when we receive feedback from the server closePopover: function(id, sendCloseEvent) { - if (!id || !this.dialogs[id]) { + if (id === undefined || !this.dialogs[id]) { console.warn('missing popover data'); return; }