Skip to content

Commit

Permalink
check dialog for e.target directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ibelem committed Jun 19, 2024
1 parent f0b03cc commit 30877b1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions nnotepad/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ document.addEventListener('DOMContentLoaded', async (e) => {
);
$$('dialog').forEach((dialog) => {
dialog.addEventListener('click', (e) => {
if (e.target &&
(e.target.id === 'srcClose' || e.target.id === 'helpClose')) {
return;
}
if (e.target !== dialog) return;
const rect = e.target.getBoundingClientRect();
if (
e.clientY < rect.top ||
Expand Down

0 comments on commit 30877b1

Please sign in to comment.