fix(options): readable swatch chips + re-enable color swatch on 'Other'
Two fixes for the navbarfontcolor working example: (1) the hex value inside the swatch chips was unreadable and obscured the color — chips are now plain color swatches with the hex in a small label BELOW each swatch (.color-chip-label), and the chips row uses gap: 10px so the swatches stand out. (2) The visible color swatch input (navbarfontcolorcustom_picker) never re-enabled when choosing 'Other…' from the dropdown: it lacked data-parent/selector_radio_childfield, so updateChild/updateAllChildren never touched it and it stayed disabled (server-side rendered disabled) — the text field was enabled but the swatch the user actually clicks stayed grayed out. The swatch now gets the child classes when parented, so it follows the mode like the text field (also fixes the same latent bug for the per-element <el>textcolorcustom pickers). OPTIONS_JS_TOKEN -> 20261126.3. jsdom test extended: swatch enabled in mode 'other'/disabled otherwise, hex below swatch, chip gap 10px asserted against css/plain.css; suite 6/6, export 0. Variants intentionally not rebuilt. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
dc27d63de5
commit
f2316d1a5d
1 changed files with 32 additions and 13 deletions
|
|
@ -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 = '20261126.2' %}
|
||||
{% set OPTIONS_JS_TOKEN = '20261126.3' %}
|
||||
{{ unregisterScriptFile(optionsPath ~ '/options.js') }}
|
||||
{{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}
|
||||
|
||||
|
|
@ -524,7 +524,8 @@
|
|||
<input type="color" name="{{ key }}_picker" data-value="{{ oParentOptions[key] }}"
|
||||
{% if currentValue matches '/^#[0-9a-fA-F]{3,8}$/' %}value="{{ currentValue }}"{% endif %}
|
||||
{% if bChildDisabled %}disabled aria-disabled="true"{% endif %}
|
||||
class="selector__colorpicker-inherit-value"/>
|
||||
{% if attr.parent != '' %}data-parent="{{ attr.parent }}"{% endif %}
|
||||
class="selector__colorpicker-inherit-value{% if attr.parent != '' %} selector_radio_childfield{% endif %}"/>
|
||||
</div>
|
||||
<input type="text" name="{{ key }}" data-inheritvalue="{{ oParentOptions[key] }}"
|
||||
value="{% if currentValue != '' and currentValue != 'inherit' %}{{ currentValue }}{% endif %}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue