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

Unified Diff: static/js/main.js

Issue 29485575: Issue 5385 - Create Site Header Component for Help Center (Closed)
Patch Set: Unfix header, implement standard spacing units Created Aug. 16, 2017, 2:37 p.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
Index: static/js/main.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/static/js/main.js
@@ -0,0 +1,13 @@
+(function(){
+ document.addEventListener("DOMContentLoaded", function()
+ {
+
+ // Change html class name from "no-js" to "js"
+ document.documentElement.className = "js";
+
+ document.getElementById('toggle-search-form').addEventListener('click', function(e) {
juliandoucette 2017/08/18 15:03:56 NIT: This doesn't seem to fit on one line.
ire 2017/08/21 15:23:20 Is it supposed to? That depends on the size of the
juliandoucette 2017/08/21 16:28:40 We follow Mozilla's rule regarding the line length
ire 2017/08/22 12:15:15 Okay. I will switch to your style of new lines the
+ e.preventDefault();
+ document.getElementById('site-search').classList.toggle('open');
juliandoucette 2017/08/18 15:03:56 NIT: I usually chain on newlines e.g. document
juliandoucette 2017/08/18 15:03:56 NIT: Our code style specifies double quotes :( (I
ire 2017/08/21 15:23:20 Okay. I like to use new lines like that for things
ire 2017/08/21 15:23:20 Done.
+ }, false);
+ }, false);
+}());

Powered by Google App Engine
This is Rietveld