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

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

Issue 29676691: Issue 6237 - Implement wd navbar component in help.eyeo.com (Closed) Base URL: https://hg.adblockplus.org/help.eyeo.com
Patch Set: Created Jan. 22, 2018, 10:39 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
1 /*! 1 /*!
2 * This file is part of help.eyeo.com. 2 * This file is part of help.eyeo.com.
3 * Copyright (C) 2017-present eyeo GmbH 3 * Copyright (C) 2017-present eyeo GmbH
4 * 4 *
5 * help.eyeo.com is free software: you can redistribute it and/or modify 5 * help.eyeo.com is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or 7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
9 * 9 *
10 * help.eyeo.com is distributed in the hope that it will be useful, 10 * help.eyeo.com is distributed in the hope that it will be useful,
(...skipping 10 matching lines...) Expand all
21 { 21 {
22 22
23 /************************************************************************** 23 /**************************************************************************
24 * General 24 * General
25 **************************************************************************/ 25 **************************************************************************/
26 26
27 // Change html class name from "no-js" to "js" 27 // Change html class name from "no-js" to "js"
28 document.documentElement.className = "js"; 28 document.documentElement.className = "js";
29 29
30 /************************************************************************** 30 /**************************************************************************
31 * Navbar
32 **************************************************************************/
33
34 function toggleNavbarCollapse()
35 {
36 var navbarCollapseEls = this.parentElement.getElementsByClassName("navbar- collapse");
37 for (var i = 0; i < navbarCollapseEls.length; i++)
38 {
39 navbarCollapseEls[i]
40 .classList.toggle("open")
41 }
42 }
43
44 var toggleNavbarCollapseEls = document.getElementsByClassName("toggle-navbar -collapse");
45 for (var i = 0; i < toggleNavbarCollapseEls.length; i++)
46 {
47 toggleNavbarCollapseEls[i]
48 .addEventListener("click", toggleNavbarCollapse, false);
49 }
50
51 /**************************************************************************
52 * CustomSelect 31 * CustomSelect
53 **************************************************************************/ 32 **************************************************************************/
54 33
55 function CustomSelect(select) 34 function CustomSelect(select)
56 { 35 {
57 this.select = select; 36 this.select = select;
58 this.close(); 37 this.close();
59 this.select 38 this.select
60 .addEventListener("click", this._onClick.bind(this), false); 39 .addEventListener("click", this._onClick.bind(this), false);
61 this.select 40 this.select
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 }; 360 };
382 361
383 var browserSelect = document.getElementById("browser-select"); 362 var browserSelect = document.getElementById("browser-select");
384 if (browserSelect) 363 if (browserSelect)
385 { 364 {
386 new BrowserSelect(browserSelect); 365 new BrowserSelect(browserSelect);
387 } 366 }
388 367
389 }, false); 368 }, false);
390 }()); 369 }());
OLDNEW

Powered by Google App Engine
This is Rietveld