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

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

Issue 29323059: Issue 2838 - top navigation links don't open on left click (Closed)
Patch Set: Created July 30, 2015, 10:09 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 "use strict"; 1 "use strict";
2 2
3 (function() 3 (function()
4 { 4 {
5 function escapeRegExp(string) 5 function escapeRegExp(string)
6 { 6 {
7 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 7 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
8 } 8 }
9 9
10 function hasClass(element, className) 10 function hasClass(element, className)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 stopPropagation(event); 64 stopPropagation(event);
65 }; 65 };
66 } 66 }
67 67
68 function navigationClick(event) 68 function navigationClick(event)
69 { 69 {
70 var element = event.target; 70 var element = event.target;
71 while (true) 71 while (true)
72 { 72 {
73 if (!element) 73 if (!element)
74 return false; 74 return;
75 75
76 if (hasClass(element, "selected") || element.id == "hamburger") 76 if (hasClass(element, "selected") || element.id == "hamburger")
77 { 77 {
78 if ("querySelector" in document) 78 if ("querySelector" in document)
79 { 79 {
80 event.preventDefault(); 80 event.preventDefault();
81 toggleClass(document.querySelector("header nav > ul"), "visible"); 81 toggleClass(document.querySelector("header nav > ul"), "visible");
82 } 82 }
83 return false; 83 return false;
84 } 84 }
(...skipping 26 matching lines...) Expand all
111 { 111 {
112 var section = footerNavSections[i]; 112 var section = footerNavSections[i];
113 initFooterSection(section); 113 initFooterSection(section);
114 } 114 }
115 } 115 }
116 116
117 initLanguageSelection(); 117 initLanguageSelection();
118 initMenu(); 118 initMenu();
119 initFooter(); 119 initFooter();
120 })(); 120 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld