mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-16 16:05:52 +00:00
Update to use existing compiled classes
This commit is contained in:
2 files changed
+24
-29
No files matched your search
@@ -4,3 +4,20 @@
|
||||
<div id="{{ $id }}" class="space-y-2" data-accordion="{{ $mode }}">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
{{ if eq $mode "collapse" }}
|
||||
<script>
|
||||
(() => {
|
||||
const root = document.getElementById("{{ $id }}");
|
||||
if (!root) return;
|
||||
const items = root.querySelectorAll("details[data-accordion-item]");
|
||||
items.forEach((item) => {
|
||||
item.addEventListener("toggle", () => {
|
||||
if (!item.open) return;
|
||||
items.forEach((other) => {
|
||||
if (other !== item) other.removeAttribute("open");
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user