Skip to content

Commit

Permalink
jsdialog: allow to close popover in sidebar
Browse files Browse the repository at this point in the history
if id is "0" it is still valid

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I52b5e69abfbf287d103fe5302c61ccbc33cfe2c6
  • Loading branch information
eszkadev committed Dec 17, 2024
1 parent 5f77875 commit 854b0b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser/src/control/Control.JSDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 854b0b9

Please sign in to comment.