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

Unified Diff: anwiki/_override-static/global/global/js/main.js

Issue 9044122: Fixed regression: menu selection doesn't work on mobile (Closed)
Patch Set: Created Dec. 21, 2012, 11:16 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: anwiki/_override-static/global/global/js/main.js
===================================================================
--- a/anwiki/_override-static/global/global/js/main.js
+++ b/anwiki/_override-static/global/global/js/main.js
@@ -77,12 +77,15 @@
function initMenu()
{
- var menu = document.getElementById("menu");
- var selectedItem = getSelectedItem(menu);
- selectedItem.onclick = function()
+ if ("querySelector" in document)
Felix Dahlke 2012/12/21 12:57:12 Why not just: if (document.querySelector)
{
- toggleClass(menu, "visible");
- };
+ var menu = document.querySelector("header nav>ul");
+ var selectedItem = getSelectedItem(menu);
+ selectedItem.onclick = function()
+ {
+ toggleClass(menu, "visible");
+ };
+ }
}
function initFooterSection(section)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld