diff options
Diffstat (limited to 'http/src')
| -rw-r--r-- | http/src/js/feed-condense-content.js | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/http/src/js/feed-condense-content.js b/http/src/js/feed-condense-content.js deleted file mode 100644 index 02361b5..0000000 --- a/http/src/js/feed-condense-content.js +++ /dev/null @@ -1,25 +0,0 @@ -const expandedClass = "e-content--expanded"; - -function toggleContentExpanded(id) { - const content = document.querySelector(`[data-content-id=${id}`); - if (!content) { - throw new Error(`No content found with ID: ${id}`); - } - const classes = content.getAttribute("class").split(" "); - if (classes.includes(expandedClass)) { - const newClasses = classes.filter((c) => c != expandedClass); - content.setAttribute("class", newClasses.join(" ")); - } else { - content.setAttribute("class", [...classes, expandedClass].join(" ")); - } -} - -function addExpandItemButtons() { - for (const content of document.querySelectorAll(".e-content")) { - const contentId = crypto.randomUUID(); - content.setAttribute("data-content-id", contentId); - const button = new HTMLButtonElement(); - button.onclick = `toggleContentExpanded(${contentId})`; - content.insertAdjacentElement("afterend", button); - } -} |
