Fix: hide colorpicker on mousedown
This commit is contained in:
parent
31535fb7b3
commit
181d9206d9
|
@ -9,6 +9,8 @@ function configDialog(style) {
|
||||||
const elements = [];
|
const elements = [];
|
||||||
const colorpicker = window.colorpicker();
|
const colorpicker = window.colorpicker();
|
||||||
|
|
||||||
|
document.addEventListener('mousedown', onMouseDown);
|
||||||
|
|
||||||
buildConfigForm();
|
buildConfigForm();
|
||||||
renderValues();
|
renderValues();
|
||||||
|
|
||||||
|
@ -29,6 +31,7 @@ function configDialog(style) {
|
||||||
t('confirmCancel')
|
t('confirmCancel')
|
||||||
]
|
]
|
||||||
}).then(({button, esc}) => {
|
}).then(({button, esc}) => {
|
||||||
|
document.removeEventListener('mousedown', onMouseDown);
|
||||||
if (button !== 1) {
|
if (button !== 1) {
|
||||||
colorpicker.hide();
|
colorpicker.hide();
|
||||||
}
|
}
|
||||||
|
@ -194,4 +197,10 @@ function configDialog(style) {
|
||||||
window.addEventListener('keydown', messageBox.listeners.key, true);
|
window.addEventListener('keydown', messageBox.listeners.key, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onMouseDown(e) {
|
||||||
|
if (!e.target.closest('.colorpicker-popup')) {
|
||||||
|
colorpicker.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user