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

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

Issue 29588576: Issue 5635 - Implement website-default navbar component (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Patch Set: Created Oct. 25, 2017, 10:02 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 /*******************************************************************************
2 * Navbar Component
3 ******************************************************************************/
4 (function()
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
« pages/navbar.md ('K') | « static/js/main.js ('k') | static/scss/_navbar.scss » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld