diff options
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; }); + }); +} |
