Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 (function(){ | 1 (function(){ |
2 document.addEventListener("DOMContentLoaded", function() | 2 document.addEventListener("DOMContentLoaded", function() |
3 { | 3 { |
4 document.getElementById('toggle-searchform').addEventListener('click', funct ion(e) { | 4 |
5 e.preventDefault(); | 5 // Change html class name from "no-js" to "js" |
6 document.getElementById('site-search').classList.toggle('open'); | 6 document.documentElement.className = "js"; |
juliandoucette
2017/07/14 14:11:29
I don't remember if we agreed upon browser require
ire
2017/07/17 09:25:54
It was my impression the support was ie 9 and up a
| |
7 }, false); | 7 |
8 // Toggle Navbar Collapse | |
9 function toggleNavbarCollapse() | |
10 { | |
11 var navbarCollapseEls = this.parentElement.getElementsByClassName("navbar- collapse"); | |
12 for (var i = 0; i < navbarCollapseEls.length; i++) | |
13 { | |
14 navbarCollapseEls[i] | |
15 .classList.toggle("open") | |
16 } | |
17 } | |
18 | |
19 var toggleNavbarCollapseEls = document.getElementsByClassName("toggle-navbar -collapse"); | |
20 for (var i = 0; i < toggleNavbarCollapseEls.length; i++) | |
21 { | |
22 toggleNavbarCollapseEls[i] | |
23 .addEventListener("click", toggleNavbarCollapse, false); | |
24 } | |
25 | |
8 }, false); | 26 }, false); |
9 }()); | 27 }()); |
LEFT | RIGHT |