Skip to content

Commit

Permalink
better handle of close modal on escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvialf committed Dec 8, 2023
1 parent 0efc1bc commit 476557a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/dom/dom.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,8 @@ var jeeDialog = (function() {
this.dialog.unseen()
this.dialog._jeeDialog.options.onClose()
this.dialog.removeClass('active')
document.querySelectorAll('div.jeeDialog.jeeDialogMain:not([style*="display: none;"])')[0]?.addClass('active')
let _dialog = document.querySelectorAll('div.jeeDialog.jeeDialogMain:not([style*="display: none;"])')
_dialog[_dialog.length - 1]?.addClass('active')
cleanBackdrop()
},
destroy: function() {
Expand Down
3 changes: 2 additions & 1 deletion desktop/common/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,10 @@ jeedomUtils.setJeedomGlobalUI = function() {
event.target.value = ''
return
}
else
else if (event.target.matches('body')) {
//close active modal
document.querySelector('div.jeeDialog.active')?._jeeDialog.close()
}
}
})

Expand Down

0 comments on commit 476557a

Please sign in to comment.