diff options
| author | historia <[not public]> | 2026-07-01 02:21:42 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 02:21:42 -0400 |
| commit | 5f37dc9b6f6b79da04da70ae0c33ec8d02998587 (patch) | |
| tree | f7c309e36267a4c456fcf5bca800e614507a80af /internal/admin/static/editor.js | |
| parent | fee376102192dc6f24297a7b11324636ace3a07d (diff) | |
| download | thehouseoficarus-5f37dc9b6f6b79da04da70ae0c33ec8d02998587.tar.gz | |
feat: qol improvements to items crud in admin gui
Diffstat (limited to 'internal/admin/static/editor.js')
| -rw-r--r-- | internal/admin/static/editor.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/admin/static/editor.js b/internal/admin/static/editor.js index 1ed0653..37bc797 100644 --- a/internal/admin/static/editor.js +++ b/internal/admin/static/editor.js @@ -59,7 +59,7 @@ function renderDirGroup(name, ids, filter) { displayIds = ids.filter(function(id) { return String(id).toLowerCase().indexOf(filter) >= 0; }); if (displayIds.length === 0) return ''; } - var expanded = isFiltering ? true : (collapsedDirs[name] === false || (!name && collapsedDirs[''] === undefined)); + var expanded = isFiltering ? true : (collapsedDirs[name] === true); var displayName = name || editorType.charAt(0).toUpperCase() + editorType.slice(1); var h = '<div class="dir-group">'; if (name) { @@ -79,7 +79,7 @@ function renderDirGroup(name, ids, filter) { } function toggleDir(name) { - collapsedDirs[name] = collapsedDirs[name] === false ? true : false; + collapsedDirs[name] = collapsedDirs[name] !== true; renderList(''); } @@ -206,6 +206,13 @@ function switchTab(e, tab) { tabs.forEach(function(t) { t.style.display = 'none'; }); var target = document.getElementById('tab' + tab.charAt(0).toUpperCase() + tab.slice(1)); if (target) target.style.display = 'block'; + + if (tab === 'yaml' && currentID) { + API.get('/api/' + editorType + '/' + encodeURIComponent(currentID)).then(function(data) { + var pre = document.querySelector('#tabYaml pre'); + if (pre) pre.textContent = data._raw || JSON.stringify(data, null, 2); + }); + } } function getNested(obj, path) { |
