fix(options): custom color picker group — equal-height parts, no third "effective" swatch
Row 143: the input group of a color-chooser's custom picker (shown when "Other ..." is chosen) had three parts and two problems: 1. The text input was lower than the swatch part (.input-group-text holding input[type=color], whose default height exceeds the form-control line box). Fixed in the inline <style> of options.twig: the color input is set to the same line box as .form-control (height: 1.5em), so swatch part and text input are both calc(1.5em + 0.75rem + 2px) tall. 2. The third part — the appended "effective color" swatch (.color-mode-effective) — is removed entirely (options.js refreshEffective / effectiveColor deleted, CSS rule deleted). The group is now just swatch + text input. OPTIONS_JS_TOKEN -> 20261126.18. Verified: render tc=663 (no color-mode-effective in the page, options.js?v=20261126.18), jsdom 7/7 incl. new pins (no third part in the DOM at load or after mode changes; equal-height rule present; stale rule gone), export exit 0. Variants not rebuilt (deferred). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
cd62f2f752
commit
02e9babe7c
1 changed files with 17 additions and 28 deletions
|
|
@ -771,19 +771,12 @@ var ThemeOptions = function () {
|
|||
|| sel.find('option').not('[value="inherit"]').first().attr('value')
|
||||
|| '');
|
||||
var customInput = globalForm.find('input[name="' + key + 'custom"]');
|
||||
var rowLabel = String(sel.closest('.mb-3').find('.form-label').first().text() || key);
|
||||
var currentColor = function (ckey) {
|
||||
var f = globalForm.find('#simple_edit_options_' + ckey);
|
||||
var v = f.val();
|
||||
if (!v) { v = f.data('inheritvalue'); }
|
||||
return v ? String(v) : '';
|
||||
};
|
||||
var effectiveColor = function () {
|
||||
var mode = String(sel.val());
|
||||
if (mode === 'other') { return customInput.length && customInput.val() ? String(customInput.val()) : ''; }
|
||||
var pk = presets[mode];
|
||||
return pk ? currentColor(pk) : '';
|
||||
};
|
||||
var refreshLabels = function () {
|
||||
sel.find('option').each(function () {
|
||||
var op = $(this);
|
||||
|
|
@ -847,19 +840,10 @@ var ThemeOptions = function () {
|
|||
.toggleClass('is-default', defaultMode !== '' && mode === defaultMode);
|
||||
});
|
||||
};
|
||||
var refreshEffective = function () {
|
||||
var group = customInput.closest('.input-group');
|
||||
if (!group.length) { return; }
|
||||
var sw = group.find('.color-mode-effective');
|
||||
if (!sw.length) {
|
||||
sw = $('<span class="color-mode-effective"></span>');
|
||||
group.append($('<div class="input-group-text"></div>').append(sw));
|
||||
}
|
||||
var c = effectiveColor();
|
||||
sw.css('background', c || 'transparent');
|
||||
sw.attr('title', c ? 'Effective color (' + rowLabel + '): ' + c : 'Effective color (' + rowLabel + '): (none)');
|
||||
};
|
||||
var refreshAll = function () { refreshLabels(); refreshChips(); refreshEffective(); };
|
||||
// row 143: NO third part in the input group any more — the "effective color"
|
||||
// swatch (.color-mode-effective) is removed; the group is just the swatch
|
||||
// part + the text input, both the same height (CSS in options.twig)
|
||||
var refreshAll = function () { refreshLabels(); refreshChips(); };
|
||||
colorModeRefreshers.push(refreshAll);
|
||||
// legacy migration: stored hex (pre-dropdown value) -> mode "other" + hex into the custom field
|
||||
var stored = legacyColorValues[key];
|
||||
|
|
|
|||
Loading…
Reference in a new issue