modal.js: Really only close the modal if the user clicks outside of it

The click event fires only after the mouse button is released, which
may happen on the outside, after the user tried to select something
and overrun accidentally. A close is then not desired as the user
may loose input. The mousedown event fires right when the button
is pressed and suffices on the outside of the modal.
This commit is contained in:
Johannes Meyer 2021-03-05 12:45:09 +01:00
parent 7790a72efa
commit 07251e6d5e
1 changed files with 1 additions and 1 deletions
public/js/icinga/behavior

View File

@ -22,7 +22,7 @@
this.on('change', '#modal form select.autosubmit', this.onFormAutoSubmit, this);
this.on('change', '#modal form input.autosubmit', this.onFormAutoSubmit, this);
this.on('click', '[data-icinga-modal]', this.onModalToggleClick, this);
this.on('click', '#layout > #modal', this.onModalLeave, this);
this.on('mousedown', '#layout > #modal', this.onModalLeave, this);
this.on('click', '.modal-header > button', this.onModalClose, this);
this.on('keydown', this.onKeyDown, this);
};