Fix modal close outside click on drag.
This commit is contained in:
parent
e9c8613b02
commit
de0a4e5dec
1 changed files with 9 additions and 2 deletions
11
index.html
11
index.html
|
|
@ -2423,6 +2423,12 @@ chmod 755 kbtd
|
|||
return false;
|
||||
}
|
||||
|
||||
let modalMousedownTarget = null;
|
||||
|
||||
document.addEventListener('mousedown', (e) => {
|
||||
modalMousedownTarget = e.target;
|
||||
});
|
||||
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!e.target.closest('.card-menu') && !e.target.closest('.card-menu-btn')) {
|
||||
closeAllCardMenus();
|
||||
|
|
@ -2433,12 +2439,13 @@ chmod 755 kbtd
|
|||
if (!e.target.closest('.project-select-dropdown') && !e.target.closest('#project-select-btn')) {
|
||||
closeProjectDropdown();
|
||||
}
|
||||
if (e.target.id === 'about-modal') {
|
||||
if (e.target.id === 'about-modal' && modalMousedownTarget && modalMousedownTarget.id === 'about-modal') {
|
||||
aboutModal.close();
|
||||
}
|
||||
if (e.target.id === 'card-detail-modal') {
|
||||
if (e.target.id === 'card-detail-modal' && modalMousedownTarget && modalMousedownTarget.id === 'card-detail-modal') {
|
||||
cardDetailModal.close();
|
||||
}
|
||||
modalMousedownTarget = null;
|
||||
});
|
||||
|
||||
$('#card-detail-title-input').addEventListener('input', updateCardDetailButtons);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue