From 011b07c735cefe63cc49c1aaefc5ce1cb0715cba Mon Sep 17 00:00:00 2001 From: jdescottes Date: Wed, 22 Jul 2015 00:10:56 +0200 Subject: [PATCH] Palette editor : Fix blur delegation on Firefox --- src/js/widgets/HslRgbColorPicker.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/widgets/HslRgbColorPicker.js b/src/js/widgets/HslRgbColorPicker.js index 9bbec39c..97ab948d 100644 --- a/src/js/widgets/HslRgbColorPicker.js +++ b/src/js/widgets/HslRgbColorPicker.js @@ -13,11 +13,13 @@ }; ns.HslRgbColorPicker.prototype.init = function () { - var isChromeOrFirefox = pskl.utils.UserAgent.isChrome || pskl.utils.UserAgent.isFirefox; - var changeEvent = isChromeOrFirefox ? 'input' : 'change'; + var isFirefox = pskl.utils.UserAgent.isFirefox; + var isChrome = pskl.utils.UserAgent.isChrome; + + var changeEvent = (isChrome || isFirefox) ? 'input' : 'change'; this.container.addEventListener(changeEvent, this.onPickerChange_.bind(this)); this.container.addEventListener('keydown', this.onKeydown_.bind(this)); - this.container.addEventListener('focusout', this.onBlur_.bind(this)); + this.container.addEventListener('blur', this.onBlur_.bind(this), true); this.spectrumEl = this.container.querySelector('.color-picker-spectrum');