Revert "Fix: hide colorpicker on mousedown"

This reverts commit 181d9206d9.
This commit is contained in:
eight 2017-12-06 04:39:54 +08:00
parent 529d2c328c
commit 3c6e2b6f6c

View File

@ -9,8 +9,6 @@ function configDialog(style) {
const elements = []; const elements = [];
const colorpicker = window.colorpicker(); const colorpicker = window.colorpicker();
document.addEventListener('mousedown', onMouseDown);
buildConfigForm(); buildConfigForm();
renderValues(); renderValues();
@ -31,7 +29,6 @@ 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();
} }
@ -197,10 +194,4 @@ 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();
}
}
} }