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

Unified Diff: static/js/main.js

Issue 29551738: Issue 5634 - Replaced logo and refactored navbar width and colors (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Patch Set: Addressed comments Created Oct. 11, 2017, 11:59 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « static/img/navbar-logo.svg ('k') | templates/default.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: static/js/main.js
===================================================================
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -42,64 +42,36 @@
&& typeof window.event.cancelBubble !== "undefined")
window.event.cancelBubble = true;
else
event.stopPropagation();
}
function initLanguageSelection()
{
- var language = document.getElementById("language");
+ var locale = document.getElementById("navbar-locale-selected");
// skip if page does not have language selection (EG: blog)
- if (!language)
+ if (!locale)
return;
- var languageSelection = language.getElementsByTagName("ul")[0];
-
- document.documentElement.onclick = function()
+ locale.onclick = function()
{
- removeClass(languageSelection, "visible");
- };
-
- language.onclick = function(event)
- {
- if (hasClass(languageSelection, "visible"))
- return;
-
- addClass(languageSelection, "visible");
- stopPropagation(event);
+ toggleClass(document.getElementById("navbar-locale-menu"), "visible");
};
}
function navigationClick(event)
{
- var element = event.target;
- while (true)
- {
- if (!element)
- return;
-
- if (hasClass(element, "selected") || element.id == "hamburger")
- {
- if ("querySelector" in document)
- {
- event.preventDefault();
- toggleClass(document.querySelector("header nav > ul"), "visible");
- }
- return false;
- }
- element = element.parentElement;
- }
+ toggleClass(document.getElementById("navbar-menu"), "visible");
}
function initMenu()
{
- if ("querySelector" in document)
- document.querySelector("header nav").onclick = navigationClick;
+ document.getElementById("navbar-menu-toggle").onclick = navigationClick;
}
function initFooterSection(section)
{
var header = section.getElementsByTagName("h1")[0];
header.onclick = function()
{
toggleClass(section, "visible");
« no previous file with comments | « static/img/navbar-logo.svg ('k') | templates/default.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld