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

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

Issue 29587584: Issue 5635 - Implement website-default navbar component (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Patch Set: Rebased Created Oct. 31, 2017, 2:07 p.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 /*******************************************************************************
2 * Navbar Component
juliandoucette 2017/10/31 15:18:37 Are you planning to add accessibility features lik
ire 2017/11/02 11:15:25 I haven't done much research either, but I would p
3 ******************************************************************************/
4 (function()
juliandoucette 2017/10/31 15:18:37 TOL: I'm not sure that we have to worry about poll
ire 2017/11/02 11:15:26 You're probably right. I'll remove it.
ire 2017/11/02 11:15:26 Done.
5 {
6 document.addEventListener("DOMContentLoaded", function()
7 {
8
9 function Navbar(navbar)
10 {
11 this.navbar = navbar;
12
13 this.navbar
14 .querySelector(".toggle-navbar-collapse")
15 .addEventListener("click", this._onClick.bind(this), false);
16 }
17
18 Navbar.prototype.toggleCollapse = function()
19 {
20 this.navbar.classList.toggle("expanded");
21 };
22
23 Navbar.prototype._onClick = function()
24 {
25 this.toggleCollapse();
26 };
27
28 var navbars = document.getElementsByClassName("navbar");
29 for (var i = 0; i < navbars.length; i++)
30 {
31 new Navbar(navbars[i]);
32 }
33
34 }, false);
35 }());
OLDNEW

Powered by Google App Engine
This is Rietveld