ui: fix javascript reference error in anime list
This commit is contained in:
@@ -14,10 +14,11 @@ templ InfiniteAnimeList(animes []jikan.Anime, hasNext bool, nextURL string, cont
|
||||
if hasNext {
|
||||
<div class="scroll-trigger" style="grid-column: 1 / -1; height: 20px;" hx-get={ nextURL } hx-trigger="revealed" hx-swap="outerHTML"></div>
|
||||
}
|
||||
<script>
|
||||
<script data-container={ containerID }>
|
||||
(function() {
|
||||
const containerID = "{" + containerID + "}"; // fallback for string concat in JS
|
||||
const actualID = containerID.replace(/[{}]/g, '');
|
||||
const scripts = document.querySelectorAll('script[data-container]');
|
||||
const currentScript = scripts[scripts.length - 1];
|
||||
const actualID = currentScript.getAttribute('data-container');
|
||||
const container = document.getElementById(actualID) || document;
|
||||
const items = container.querySelectorAll('.catalog-item[data-id]');
|
||||
const seen = new Set();
|
||||
|
||||
Reference in New Issue
Block a user