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

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

Issue 29348931: Issue 4189 - Sections not expanding on the blog page on adblockplus.org (Closed)
Patch Set: Created Aug. 1, 2016, 2:58 p.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 30 matching lines...) Expand all
41 if (typeof window.event !== "undefined" 41 if (typeof window.event !== "undefined"
42 && typeof window.event.cancelBubble !== "undefined") 42 && typeof window.event.cancelBubble !== "undefined")
43 window.event.cancelBubble = true; 43 window.event.cancelBubble = true;
44 else 44 else
45 event.stopPropagation(); 45 event.stopPropagation();
46 } 46 }
47 47
48 function initLanguageSelection() 48 function initLanguageSelection()
49 { 49 {
50 var language = document.getElementById("language"); 50 var language = document.getElementById("language");
51
52 // skip if page does not have language selection (EG: blog)
53 if (!language)
54 return;
55
51 var languageSelection = language.getElementsByTagName("ul")[0]; 56 var languageSelection = language.getElementsByTagName("ul")[0];
52 57
53 document.documentElement.onclick = function() 58 document.documentElement.onclick = function()
54 { 59 {
55 removeClass(languageSelection, "visible"); 60 removeClass(languageSelection, "visible");
56 }; 61 };
57 62
58 language.onclick = function(event) 63 language.onclick = function(event)
59 { 64 {
60 if (hasClass(languageSelection, "visible")) 65 if (hasClass(languageSelection, "visible"))
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 { 116 {
112 var section = footerNavSections[i]; 117 var section = footerNavSections[i];
113 initFooterSection(section); 118 initFooterSection(section);
114 } 119 }
115 } 120 }
116 121
117 initLanguageSelection(); 122 initLanguageSelection();
118 initMenu(); 123 initMenu();
119 initFooter(); 124 initFooter();
120 })(); 125 })();
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