From 21c1997a3fd0f5ec5dcff1add45e4dfaf7a338ca Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 5 Jul 2026 03:45:48 -0400 Subject: fix: use interaction cards in admin gui work, fix card css on object tab --- internal/admin/static/itemeditor.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'internal/admin/static/itemeditor.js') diff --git a/internal/admin/static/itemeditor.js b/internal/admin/static/itemeditor.js index f1450ab..5a2b371 100644 --- a/internal/admin/static/itemeditor.js +++ b/internal/admin/static/itemeditor.js @@ -166,6 +166,7 @@ function loadItemEditor(id) { window.location.hash = id; API.get('/api/items/' + encodeURIComponent(id)).then(function(data) { itemData = data; + window._editorData = itemData; renderItemEditor(id, data); }).catch(function(e) { $('#editorMain').innerHTML = '

Failed to load: ' + esc(e.message) + '

'; @@ -524,7 +525,16 @@ function renderField(sec, f, data, idx, subPath, optStyle) { if (type === 'search') { var entity = searchEntity || 'items'; var ph = hint ? ' placeholder="' + esc(hint) + '"' : ' placeholder="Search ' + entity + '..."'; - return wrap('obj-field obj-search', '' + esc(label) + '
'); + var pfx = cardPath(sec); + var dp; + if (idx >= 0) { + dp = pfx + '[' + idx + '].' + key; + } else if (subPath) { + dp = (pfx ? pfx + '.' : '') + subPath + '.' + key; + } else { + dp = (pfx ? pfx + '.' : '') + key; + } + return wrap('obj-field obj-search', '' + esc(label) + '
'); } var ph = hint ? ' placeholder="' + esc(hint) + '"' : ''; return wrap('obj-field', '' + esc(label) + ''); @@ -568,7 +578,8 @@ function renderSubFieldHTML(sec, stKey, idx, f, val) { if (f[2] === 'search') { var entity = f[6] || 'items'; var ph = f[3] ? ' placeholder="' + escAttr(f[3]) + '"' : ' placeholder="Search ' + entity + '..."'; - return ''; + var dp = cardPath(sec) + '.' + stKey + '[' + idx + '].' + f[0]; + return ''; } if (f[2] === 'checkbox') { return ''; -- cgit v1.2.3