Skip to main content

max / makenotwork

682 B · 21 lines History Blame Raw
1 // Loaded via HTMX into #tab-content (no DOMContentLoaded), so init immediately,
2 // lazy-loading gallery.js if needed.
3 (function() {
4 var cfg = document.getElementById('tab-item-details-cfg');
5 var itemId = cfg.dataset.itemId;
6 function go() {
7 initGalleryManager({
8 targetType: 'item',
9 targetId: itemId,
10 listId: 'item-gallery-list',
11 inputId: 'item-gallery-input',
12 statusId: 'item-gallery-status'
13 });
14 }
15 if (window.initGalleryManager) { go(); return; }
16 var s = document.createElement('script');
17 s.src = '/static/gallery.js';
18 s.onload = go;
19 document.head.appendChild(s);
20 })();
21