fix colorpicker keyboard increment with #HEX in CAPS

This commit is contained in:
tophf 2017-11-23 19:28:37 +03:00
parent 80547aef70
commit 7c746ab9a3

View File

@ -378,7 +378,7 @@ CodeMirror.defineExtension('colorpicker', function () {
if (currentFormat === 'hex') { if (currentFormat === 'hex') {
value = el.value.trim(); value = el.value.trim();
const isShort = value.length <= 5; const isShort = value.length <= 5;
const [r, g, b, a = ''] = el.value.match(isShort ? /[\da-f]/g : /[\da-f]{2}/g); const [r, g, b, a = ''] = el.value.match(isShort ? /[\da-f]/gi : /[\da-f]{2}/gi);
let ceiling, data; let ceiling, data;
if (!ctrl && !shift && !alt) { if (!ctrl && !shift && !alt) {
ceiling = isShort ? 0xFFF : 0xFFFFFF; ceiling = isShort ? 0xFFF : 0xFFFFFF;