From 1040c20330f850e05bb2b90b937691b27e60e745 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 24 Dec 2017 14:32:53 +0300 Subject: [PATCH] don't autohide colorpicker popup when invoked via hotkey --- vendor-overwrites/colorpicker/colorpicker.js | 8 +++++--- vendor-overwrites/colorpicker/colorview.js | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vendor-overwrites/colorpicker/colorpicker.js b/vendor-overwrites/colorpicker/colorpicker.js index c08d327b..f852d765 100644 --- a/vendor-overwrites/colorpicker/colorpicker.js +++ b/vendor-overwrites/colorpicker/colorpicker.js @@ -832,8 +832,6 @@ const NAMED_COLORS = new Map([ window.addEventListener('keydown', onKeyDown, true); window.addEventListener('mousedown', onMouseDown, true); window.addEventListener('close-colorpicker-popup', onCloseRequest, true); - $root.addEventListener('mouseleave', snooze); - $root.addEventListener('mouseenter', stopSnoozing); $root.addEventListener('input', setFromInputs); $root.addEventListener('keydown', setFromKeyboard); $formatChangeButton.addEventListener('click', setFromFormatElement); @@ -847,7 +845,11 @@ const NAMED_COLORS = new Map([ $hexLettercase.false.addEventListener('click', onHexLettercaseClicked); stopSnoozing(); - timerFadeColorPicker = setTimeout(fade, options.hideDelay / 2); + if (!options.isShortCut) { + $root.addEventListener('mouseleave', snooze); + $root.addEventListener('mouseenter', stopSnoozing); + timerFadeColorPicker = setTimeout(fade, options.hideDelay / 2); + } } function unregisterEvents() { diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index 1b0f26b2..754e4836 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -496,7 +496,6 @@ cm: state.cm, color: data.color, prevColor: data.color || '', - isShortCut: false, callback: popupOnChange, })); }