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] : '')) %} -
- +
+
{% endfor %}
@@ -409,8 +409,13 @@
- {# label ALWAYS above the control, for every option type #} - + {# label ALWAYS above the control, for every option type EXCEPT checkbox + (checkboxes carry their label to the RIGHT of the box, rendered in + the checkbox branch below). d-block so the label gets its own line + even next to an inline-flex control (btn-group buttons). #} + {% if attr.type != 'checkbox' %} + + {% endif %} {% if key == 'headersticky' %} {% elseif attr.type == 'buttons' %} @@ -435,18 +440,21 @@
{% elseif attr.type == 'checkbox' %} - {# checkbox: checked = "on", unchecked = "off". The label sits above - the box via the generic form-label at the top of this block (same - id lbl_simple_edit_options_, so tests/JS anchors keep working). - With survey-level inherit, an untouched box keeps the value - "inherit" (options.js: data was-inherit). Children of a parent - switch get selector_radio_childfield + data-parent. #} - + {# checkbox: checked = "on", unchecked = "off". The box comes BEFORE + its label (classic .form-check, label to the right of the box); the + label keeps the same id (lbl_simple_edit_options_) so tests/JS + anchors keep working. With survey-level inherit, an untouched box + keeps the value "inherit" (options.js: data was-inherit). Children + of a parent switch get selector_radio_childfield + data-parent. #} +
+ + +
{% elseif attr.type == 'dropdown' %} {% set ddClasses = 'form-select selector_option_value_field' %}