feat(options): show the default choice of a color-chooser in bold (data-default marker)
The 5 named color choices were already in the requested order (row 125):
Default font color | Default background color | Color 1 | Color 2 | Color 3
('Other…' stays as the 6th dropdown entry that opens the custom picker).
New: the option's default choice is now visually marked. config.xml marks
the default <option data-default="1"> of every color-chooser dropdown
(navbarfontcolor + the five <el>textcolor dropdowns); options.twig's inline
<style> renders those options bold (select option[data-default="1"]) and
options.js adds .is-default (bold) to the matching swatch label, reading the
default from the DOM so any future chooser gets it automatically. For
navbarfontcolor the default is 'default' = 'Same as default font color'.
OPTIONS_JS_TOKEN -> 20261126.8. Verified: render tc=588 (dropdown order
default,defaultbackgroundcolor,color1,color2,color3,other with
data-default on 'default'; served as options.js?v=20261126.8), jsdom 6/6
incl. 4 new row-126 pins, export_public.sh exit 0. No view changes, live
survey unaffected. Variants not rebuilt (deferred).
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
2f08e86335
commit
6300beaa88
2 changed files with 29 additions and 12 deletions
|
|
@ -754,6 +754,10 @@ var ThemeOptions = function () {
|
|||
// "Default background color" is the SECOND choice, right after "Same as
|
||||
// default font color".
|
||||
var presets = { 'default': 'fontcolor', 'defaultbackgroundcolor': 'defaultbackgroundcolor', 'color1': 'primarycolor', 'color2': 'secondarycolor', 'color3': 'tertiarycolor' };
|
||||
// row 126: the option's DEFAULT choice — the config.xml <option data-default="1">
|
||||
// (same value as the <default> element text). Shown bold in the dropdown by
|
||||
// CSS (select option[data-default="1"]) and on the swatch label (is-default).
|
||||
var defaultMode = String(sel.find('option[data-default="1"]').first().attr('value') || '');
|
||||
var customInput = globalForm.find('input[name="navbarfontcolorcustom"]');
|
||||
var currentColor = function (key) {
|
||||
var f = globalForm.find('#simple_edit_options_' + key);
|
||||
|
|
@ -814,7 +818,8 @@ var ThemeOptions = function () {
|
|||
chip.attr('title', mode + (c ? ' [' + c + ']' : ''));
|
||||
chip.attr('aria-label', chip.attr('title'));
|
||||
chip.toggleClass('active', String(sel.val()) === mode);
|
||||
chip.siblings('.color-chip-label').first().text(c || '');
|
||||
chip.siblings('.color-chip-label').first().text(c || '')
|
||||
.toggleClass('is-default', defaultMode !== '' && mode === defaultMode);
|
||||
});
|
||||
};
|
||||
var refreshEffective = function () {
|
||||
|
|
|
|||
|
|
@ -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.7' %}
|
||||
{% set OPTIONS_JS_TOKEN = '20261126.8' %}
|
||||
{{ unregisterScriptFile(optionsPath ~ '/options.js') }}
|
||||
{{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}
|
||||
|
||||
|
|
@ -154,6 +154,16 @@
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
/* row 126: the DEFAULT choice of a color-chooser option (the config.xml
|
||||
<option data-default="1">) is shown in bold — in the dropdown (CSS below)
|
||||
and on its swatch label (is-default class set by options.js) */
|
||||
select option[data-default="1"] {
|
||||
font-weight: 700;
|
||||
}
|
||||
.color-chip-label.is-default {
|
||||
font-weight: 700;
|
||||
color: #212529;
|
||||
}
|
||||
.color-mode-effective {
|
||||
display: inline-block;
|
||||
width: 1.1rem;
|
||||
|
|
|
|||
Loading…
Reference in a new issue