diff options
| author | historia <[not public]> | 2026-07-13 17:25:14 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-13 17:25:14 -0400 |
| commit | 8952653be9bfeeb9aadf59f845de507630d65dc4 (patch) | |
| tree | 64babb2c89568734cc5ff59b386845f1707f7ecf /internal/admin/static/dropeditor.js | |
| parent | 709917f657eda63f10ea244546e8bb7fd4d839e8 (diff) | |
| download | thehouseoficarus-8952653be9bfeeb9aadf59f845de507630d65dc4.tar.gz | |
feat(admin): add drop tables to gui showing 1/n drop chances
Diffstat (limited to 'internal/admin/static/dropeditor.js')
| -rw-r--r-- | internal/admin/static/dropeditor.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/admin/static/dropeditor.js b/internal/admin/static/dropeditor.js index 5900930..e8ade87 100644 --- a/internal/admin/static/dropeditor.js +++ b/internal/admin/static/dropeditor.js @@ -78,6 +78,7 @@ function renderDropEditor(id, data) { $('#editorMain').innerHTML = html; setupSearchFields(); + setupDropEditorDropView(); } function renderCurrent() { @@ -140,6 +141,7 @@ function renderArraySection(sec, data) { h += '<button class="btn btn-sm obj-sub-add" style="flex:1;margin-top:0" onclick="addDropRow(\'' + sec.id + '\',\'item\')">+ Add Item Row</button>'; h += '<button class="btn btn-sm obj-sub-add" style="flex:1;margin-top:0" onclick="addDropRow(\'' + sec.id + '\',\'table\')">+ Add Table Row</button>'; h += '</div>'; + h += '<div class="obj-drop-view"></div>'; return h; } @@ -291,3 +293,12 @@ function duplicateDrop() { loadDropEditor(newID); }).catch(function(e) { notify('Duplicate failed: ' + e.message, 'error'); }); } + +function setupDropEditorDropView() { + var card = document.querySelector('.obj-card[data-card="drops"]'); + if (!card) return; + DropView.mount(card.querySelector('.obj-card-body'), function() { + ced_syncDOMToData(dropData); + return (dropData.drops || []).filter(function(e) { return e.item_id || e.table; }); + }); +} |
