Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: static/js/main.js

Issue 29485575: Issue 5385 - Create Site Header Component for Help Center (Closed)
Patch Set: Implement navbar-collapse Created Aug. 25, 2017, 8:25 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 (function(){
2 document.addEventListener("DOMContentLoaded", function()
juliandoucette 2017/08/29 16:17:29 NIT: We can support this in IE8 via https://github
ire 2017/09/01 10:57:22 This was already added, but I had an incorrect fil
3 {
4
5 // Change html class name from "no-js" to "js"
6 document.documentElement.className = "js";
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")
juliandoucette 2017/08/29 16:17:29 NIT: We can support this in IE < 10 via https://gi
ire 2017/09/01 10:57:21 Done.
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
26 }, false);
27 }());
OLDNEW

Powered by Google App Engine
This is Rietveld