blob: 08aab18212ec0eb23ccc44c2a6a8ce3935658f1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<div class="dropdown" id="langDrop">
<div class="dropdown-trigger">
<button class="button" aria-haspopup="true" aria-controls="dropdown-menu" onclick="toggleDropdownActive();">
<span>{{ .Language.LanguageName }} ↓</span>
</button>
</div>
<div class="dropdown-menu" id="dropdown-menu" role="menu">
<div class="dropdown-content">
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home }}
{{ range $langPage.Translations }}
<a href="{{ .RelPermalink }}" class="dropdown-item">{{ .Language.LanguageName }}</a>
{{ end }}
</div>
</div>
</div>
<script>
function toggleDropdownActive() {
var obj = document.getElementById("langDrop");
obj.classList.toggle("is-active");
}
</script>
|