From 2fdc85556bea709f5ad5f342e4b4ad0c45c2441d Mon Sep 17 00:00:00 2001 From: jdescottes Date: Tue, 21 Jul 2015 23:40:55 +0200 Subject: [PATCH] Palette Editor : Fix color change from hex input --- src/js/widgets/HslRgbColorPicker.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/widgets/HslRgbColorPicker.js b/src/js/widgets/HslRgbColorPicker.js index 1ddc7f5c..9bbec39c 100644 --- a/src/js/widgets/HslRgbColorPicker.js +++ b/src/js/widgets/HslRgbColorPicker.js @@ -36,6 +36,9 @@ this.spectrumEl = null; }; + /** + * Handle change event on all color inputs + */ ns.HslRgbColorPicker.prototype.onPickerChange_ = function (evt) { var target = evt.target; if (target.dataset.dimension) { @@ -47,6 +50,9 @@ } }; + /** + * Handle up/down arrow keydown on text inputs + */ ns.HslRgbColorPicker.prototype.onKeydown_ = function (evt) { var target = evt.target; @@ -90,7 +96,7 @@ this.setColor(color); } } else if (model === 'hex') { - if (/^#([a-f0-9]{3}) {1,2}$/i.test(value)) { + if (/^#([a-f0-9]{3}){1,2}$/i.test(value)) { this.setColor(value); } }