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

Unified Diff: static/js/main.js

Issue 29355239: Issue 4481 - Scripts should expect the language selector to be missing, e.g. on the blog (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org/
Patch Set: Created Sept. 28, 2016, 11:10 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 | « no previous file | no next file » | 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
@@ -43,16 +43,19 @@
window.event.cancelBubble = true;
else
event.stopPropagation();
}
function initLanguageSelection()
{
var language = document.getElementById("language");
+ if (!language)
saroyanm 2016/09/28 12:34:27 Detail: I think it make sense to have a small comm
+ return;
+
var languageSelection = language.getElementsByTagName("ul")[0];
document.documentElement.onclick = function()
{
removeClass(languageSelection, "visible");
};
language.onclick = function(event)
@@ -76,17 +79,17 @@
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;
}
}
function initMenu()
{
if ("querySelector" in document)
document.querySelector("header nav").onclick = navigationClick;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld