diff options
| author | historia <[not public]> | 2026-07-03 16:55:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-03 16:55:23 -0400 |
| commit | 034187d1c434b6bee32aeb539ea543f6ec537376 (patch) | |
| tree | f238a9c6a657af20edf0c53e9d0980bc58c1133a /internal/admin/static/itemeditor.js | |
| parent | 778157981cccb8cb4856e3ab5a72085830c59120 (diff) | |
| download | thehouseoficarus-034187d1c434b6bee32aeb539ea543f6ec537376.tar.gz | |
feat: card ui added to drops, hazards, techs, and mods in admin gui
Diffstat (limited to 'internal/admin/static/itemeditor.js')
| -rw-r--r-- | internal/admin/static/itemeditor.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/admin/static/itemeditor.js b/internal/admin/static/itemeditor.js index 215baf0..641f064 100644 --- a/internal/admin/static/itemeditor.js +++ b/internal/admin/static/itemeditor.js @@ -2,6 +2,7 @@ var itemData = null; var itemID = null; var expandedCards = {}; var addedSections = {}; +var cardWidths = {}; var SECTIONS = [ { @@ -231,9 +232,12 @@ function renderCurrent() { function renderCard(sec, data) { var collapsed = expandedCards[sec.id] === false; - var h = '<div class="obj-card" data-card="' + sec.id + '">'; + var isFull = cardWidths[sec.id] !== undefined ? cardWidths[sec.id] : (sec.fullWidth || false); + var fullClass = isFull ? ' obj-card-full' : ''; + var h = '<div class="obj-card' + fullClass + '" data-card="' + sec.id + '">'; h += '<div class="obj-card-header" onclick="toggleCard(\'' + sec.id + '\')">'; h += '<span class="obj-card-arrow">' + (collapsed ? '▶' : '▼') + '</span>'; + h += '<button class="btn btn-sm obj-card-expand" onclick="event.stopPropagation();toggleCardWidth(\'' + sec.id + '\')" title="' + (isFull ? 'Half width' : 'Full width') + '">' + (isFull ? '\u229F' : '\u229E') + '</button>'; h += '<span class="obj-card-label">' + sec.label + '</span>'; if (!sec.always) { h += '<button class="btn btn-sm btn-danger obj-card-remove" onclick="event.stopPropagation();removeSection(\'' + sec.id + '\')">X</button>'; @@ -868,6 +872,11 @@ function toggleCard(id) { renderCurrent(); } +function toggleCardWidth(id) { + cardWidths[id] = !cardWidths[id]; + renderCurrent(); +} + function removeSection(id) { var sec = SECTIONS.find(function(s) { return s.id === id; }); if (!sec) return; |
