Hide immutable type field in color strip source edit modal
Type is set at creation and cannot be changed, so hide the selector when editing (same pattern already used in value source editor). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -822,6 +822,9 @@ export async function showCSSEditor(cssId = null, cloneData = null) {
|
|||||||
document.getElementById('css-editor-led-count').value = css.led_count ?? 0;
|
document.getElementById('css-editor-led-count').value = css.led_count ?? 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Hide type selector in edit mode (type is immutable)
|
||||||
|
document.getElementById('css-editor-type-group').style.display = cssId ? 'none' : '';
|
||||||
|
|
||||||
if (cssId) {
|
if (cssId) {
|
||||||
const resp = await fetchWithAuth(`/color-strip-sources/${cssId}`);
|
const resp = await fetchWithAuth(`/color-strip-sources/${cssId}`);
|
||||||
if (!resp.ok) throw new Error('Failed to load color strip source');
|
if (!resp.ok) throw new Error('Failed to load color strip source');
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<input type="text" id="css-editor-name" data-i18n-placeholder="color_strip.name.placeholder" placeholder="Wall Strip" required>
|
<input type="text" id="css-editor-name" data-i18n-placeholder="color_strip.name.placeholder" placeholder="Wall Strip" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div id="css-editor-type-group" class="form-group">
|
||||||
<div class="label-row">
|
<div class="label-row">
|
||||||
<label for="css-editor-type" data-i18n="color_strip.type">Type:</label>
|
<label for="css-editor-type" data-i18n="color_strip.type">Type:</label>
|
||||||
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
|
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?" data-i18n-aria-label="aria.hint">?</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user