feat(options): Questions tab as 3 columns with conditional border options + new questionhelpfontcolor (Prompt R)

config.xml: Questions options reordered into the three pane columns
(col1 colors+help, col2 border + children, col3 checkbox color), all
width=12; new colorpicker questionhelpfontcolor (default #444444);
questionbordercolor/style/dropdown + 4 radii get parent="questionborder".
options.twig: Questions pane renders three col-md-4 columns (border-start
between), options stacked as col-12; aShowIfValues map carries the
multi-value show list (box|top) as data-show-if-value since core passes
only parent through; server-side initial d-none is multi-value aware
(Prompt Q logic extended); buttons/colorpicker children now also get
data-parent/selector_radio_childfield. options.js: updateVisibilityByParent
and updateChild are multi-value + checked-radio aware (single-value
behaviour unchanged); OPTIONS_JS_TOKEN bumped.
custom_header.twig: .question-help-container gets color from
questionhelpfontcolor.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-25 11:35:18 +01:00
commit 671fba4aff

View file

@ -311,9 +311,14 @@ var ThemeOptions = function () {
let enabled = true;
if(parentEl.length) {
const parentOn = $(parentEl).val() === 'on';
const parentChecked = $(parentEl).prop('checked') === true;
enabled = parentOn && parentChecked;
// THEME ADDITION (Prompt R): parentEl is a SET of radios — read the
// CHECKED one (not the first element) and accept any of the wrapper's
// show-values (data-show-if-value, pipe-separated). Single-value
// parents ('on') behave exactly as before.
const checked = parentEl.filter(':checked');
const wrapper = $(childEl).closest('.option-visibility');
const showValues = String(wrapper.data('show-if-value') || 'on').split('|');
enabled = checked.length > 0 && showValues.indexOf(String(checked.val())) !== -1;
}
$(childEl).prop('disabled', !enabled);
@ -343,7 +348,10 @@ var ThemeOptions = function () {
const updateVisibilityByParent = function() {
$('.option-visibility[data-show-if-parent]').each(function (i, wrapperEl) {
const parentName = $(wrapperEl).data('show-if-parent');
const showValue = $(wrapperEl).data('show-if-value') || 'on';
// THEME ADDITION (Prompt R): multi-value — data-show-if-value may be a
// pipe-separated list (e.g. "box|top" for questionborder); a single
// value keeps working unchanged.
const showValues = String($(wrapperEl).data('show-if-value') || 'on').split('|');
const parentInputs = $('input[name="' + parentName + '"]');
// no parent input in the markup (e.g. font's self-parent): always visible,
// same fallback as updateChild() above
@ -352,7 +360,7 @@ var ThemeOptions = function () {
return;
}
const checked = parentInputs.filter(':checked');
const visible = checked.length > 0 && checked.val() === String(showValue);
const visible = checked.length > 0 && showValues.indexOf(String(checked.val())) !== -1;
$(wrapperEl).toggleClass('d-none', !visible);
});
};