Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /******************************************************************************* | |
2 * Navbar Component | |
3 ******************************************************************************/ | |
4 | |
5 document.addEventListener("DOMContentLoaded", function() | |
6 { | |
7 | |
8 function Navbar(navbar) | |
juliandoucette
2017/11/15 12:56:42
bug: If you resize down, open the collapse, then r
ire
2017/11/30 14:01:18
Done.
| |
9 { | |
10 this.navbar = navbar; | |
11 | |
12 this.navbar | |
13 .querySelector(".toggle-navbar-collapse") | |
14 .addEventListener("click", this._onClick.bind(this), false); | |
15 } | |
16 | |
17 Navbar.prototype.toggleCollapse = function() | |
18 { | |
19 this.navbar.classList.toggle("expanded"); | |
20 }; | |
21 | |
22 Navbar.prototype._onClick = function() | |
23 { | |
24 this.toggleCollapse(); | |
25 }; | |
26 | |
27 var navbars = document.getElementsByClassName("navbar"); | |
28 for (var i = 0; i < navbars.length; i++) | |
29 { | |
30 new Navbar(navbars[i]); | |
31 } | |
32 | |
33 }, false); | |
OLD | NEW |