OLD | NEW |
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 (function() | 3 (function() |
4 { | 4 { |
| 5 document.documentElement.className = "js"; |
| 6 |
5 function initLanguageSelection() | 7 function initLanguageSelection() |
6 { | 8 { |
7 var locale = document.getElementById("navbar-locale-selected"); | 9 var locale = document.getElementById("navbar-locale-selected"); |
8 | 10 |
9 // skip if page does not have language selection (EG: blog) | 11 // skip if page does not have language selection (EG: blog) |
10 if (!locale) return; | 12 if (!locale) return; |
11 | 13 |
12 locale.addEventListener("click", function() | 14 locale.addEventListener("click", function() |
13 { | 15 { |
14 document.getElementById("navbar-locale-menu") | 16 document.getElementById("navbar-locale-menu") |
15 .classList.toggle("visible"); | 17 .classList.toggle("visible"); |
16 }, false); | 18 }, false); |
17 } | 19 } |
18 | 20 |
19 function navigationClick(event) | 21 function navigationClick(event) |
20 { | 22 { |
21 document.getElementById("navbar-menu") | 23 document.getElementById("navbar-menu") |
22 .classList.toggle("visible"); | 24 .classList.toggle("visible"); |
23 } | 25 } |
24 | 26 |
25 function initMenu() | 27 function initMenu() |
26 { | 28 { |
27 document.getElementById("navbar-menu-toggle") | 29 document.getElementById("navbar-menu-toggle") |
28 .addEventListener("click", navigationClick, false); | 30 .addEventListener("click", navigationClick, false); |
29 } | 31 } |
30 | 32 |
31 initLanguageSelection(); | 33 initLanguageSelection(); |
32 initMenu(); | 34 initMenu(); |
33 })(); | 35 })(); |
OLD | NEW |