aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/index
diff options
context:
space:
mode:
authorMantas <11616378+mistermantas@users.noreply.github.com>2019-05-12 12:14:10 +0300
committerMantas <11616378+mistermantas@users.noreply.github.com>2019-05-12 12:14:10 +0300
commit7faf0860dfe7e6110669cda0963a7f0d60ce0dda (patch)
tree7dbce36da0f08e2349702af66e78f577b54b8bb2 /layouts/partials/index
parentc62329ce102df226cc62b832232d6e9d528bd0df (diff)
IE8+ JavaScript
Diffstat (limited to 'layouts/partials/index')
-rw-r--r--layouts/partials/index/components.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html
index 803c44f..135349a 100644
--- a/layouts/partials/index/components.html
+++ b/layouts/partials/index/components.html
@@ -10,10 +10,20 @@
{{ $systems := .Site.Params.systems }}
{{ $categories := .Site.Params.categories }}
+ <script>
+ function toggleCategoryHead(el) {
+ if (el.parentNode.className == 'category category--open') {
+ el.parentNode.className = 'category category--closed';
+ } else {
+ el.parentNode.className = 'category category--open';
+ }
+ }
+ </script>
+
{{ range $categories }}
<div class="category {{ if .closed }}category--closed{{ else }}category--open{{ end }}" id="{{ .name | urlize }}">
{{ if not .untitled }}
- <div class="bold padding clicky category__head" onclick="this.parentNode.classList.toggle('category--closed'); this.parentNode.classList.toggle('category--open')">
+ <div class="bold padding clicky category__head" onclick="toggleCategoryHead(this)">
<span class="hide-without-js">
<span class="category__closed-marker">⯈</span>
<span class="category__open-marker">⯆</span>