mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-18 00:20:13 +01:00
fix: restore htmx pagination and seed theme defaults
This commit is contained in:
parent
4f7d39acba
commit
6e9ba244c9
14 changed files with 66 additions and 28227 deletions
|
|
@ -84,7 +84,14 @@
|
|||
resultsHost.setAttribute('aria-busy','true');
|
||||
fetch('/themes/fragment/list_simple?'+ps, {cache:'no-store'})
|
||||
.then(r=>r.text())
|
||||
.then(html=>{ resultsHost.innerHTML=html; resultsHost.removeAttribute('aria-busy'); renderActive(); })
|
||||
.then(html=>{
|
||||
resultsHost.innerHTML=html;
|
||||
if(window.htmx && typeof window.htmx.process==='function'){
|
||||
window.htmx.process(resultsHost);
|
||||
}
|
||||
resultsHost.removeAttribute('aria-busy');
|
||||
renderActive();
|
||||
})
|
||||
.catch(()=>{ resultsHost.innerHTML='<div class="empty" style="font-size:13px;">Failed to load.</div>'; resultsHost.removeAttribute('aria-busy'); });
|
||||
}
|
||||
function performSearch(q){
|
||||
|
|
|
|||
|
|
@ -163,7 +163,17 @@ mark { background:#fde68a; color:inherit; padding:0 2px; border-radius:2px; }
|
|||
toggleRefreshBtn(true);
|
||||
fetch('/themes/fragment/list?'+base, {cache:'no-store', signal: controller.signal})
|
||||
.then(r=>r.text())
|
||||
.then(html=>{ if(controller.signal.aborted) return; target.innerHTML = html; target.removeAttribute('aria-busy'); target.classList.remove('preload-hide'); listRenderComplete(); toggleRefreshBtn(false); })
|
||||
.then(html=>{
|
||||
if(controller.signal.aborted) return;
|
||||
target.innerHTML = html;
|
||||
if(window.htmx && typeof window.htmx.process==='function'){
|
||||
window.htmx.process(target);
|
||||
}
|
||||
target.removeAttribute('aria-busy');
|
||||
target.classList.remove('preload-hide');
|
||||
listRenderComplete();
|
||||
toggleRefreshBtn(false);
|
||||
})
|
||||
.catch(err=>{ if(controller.signal.aborted) return; target.innerHTML = '<div class="error" role="alert">Failed loading themes. <button id="retry-fetch" class="btn btn-ghost">Retry</button></div>'; target.removeAttribute('aria-busy'); target.classList.remove('preload-hide'); attachRetry(); structuredLog('list_fetch_error'); announceResultCount(); toggleRefreshBtn(false); });
|
||||
}
|
||||
function attachRetry(){ var b=document.getElementById('retry-fetch'); if(!b) return; b.addEventListener('click', function(){ fetchList(); }); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue