diff --git a/options/options.js b/options/options.js index b4e3f62..ace04fe 100644 --- a/options/options.js +++ b/options/options.js @@ -511,8 +511,13 @@ var ThemeOptions = function () { //hotswapping the colorpickers and adding the reset functionality var hotswapColorPicker = function () { + // THEME ADDITION: bind 'input' as well as 'change' — browsers fire 'input' + // live while the native color popup is dragged and 'change' only when it + // closes, so without 'input' a color picked but not yet "closed" would be + // lost when Save is clicked; syncing live makes the text field (and thus + // the saved options JSON) always carry the latest picked color. globalForm.find('.selector__colorpicker-inherit-value') - .on('change', function (e) { + .on('change input', function (e) { $(this).closest('.input-group').find('.selector_option_value_field').val($(this).val()).trigger('change'); }); diff --git a/options/options.twig b/options/options.twig index c803e53..41f4901 100644 --- a/options/options.twig +++ b/options/options.twig @@ -43,7 +43,7 @@ heuristically cached copy (the file has only Last-Modified/ETag, no Cache-Control). Re-register it with a version token: bump OPTIONS_JS_TOKEN below whenever options/options.js changes, so every browser fetches the new file once. #} -{% set OPTIONS_JS_TOKEN = '20261125.2' %} +{% set OPTIONS_JS_TOKEN = '20261125.3' %} {{ unregisterScriptFile(optionsPath ~ '/options.js') }} {{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }} @@ -355,13 +355,13 @@ {% set ckey = pos ~ 'showon' ~ dev %} {% set cattr = aOptionAttributes.optionAttributes[ckey] %} {% set ccv = bGeneralInherit ? 'inherit' : (aCurrentOptions[ckey] is defined ? aCurrentOptions[ckey] : (oParentOptions[ckey] is defined ? oParentOptions[ckey] : '')) %} -