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

Unified Diff: static/js/main.js

Issue 29488555: Issue 5406 - Create Site Footer Component for Help Center (Closed)
Patch Set: Rebase Created Aug. 11, 2017, 4:08 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,27 @@
+(function(){
+ document.addEventListener("DOMContentLoaded", function() {
juliandoucette 2017/08/22 14:33:42 NIT: We are supposed to put brackets on the next l
ire 2017/09/04 20:28:06 Done.
+
+ // Change html class name from "no-js" to "js"
+ document.documentElement.className = "js";
+
+ // Custom Select
+ var customSelects = document.getElementsByClassName('custom-select-selected');
+ function onClickCustomSelect(e) {
+ var options = e.target.nextElementSibling;
+ if (options.getAttribute("aria-hidden") == "true")
+ {
+ options.removeAttribute("aria-hidden");
+ e.target.setAttribute("aria-expanded", "true");
+ }
+ else
+ {
+ options.setAttribute("aria-hidden", "true");
+ e.target.setAttribute("aria-expanded", "false");
+ }
+ }
+ for (var i = 0; i < customSelects.length; i++) {
+ customSelects[i].addEventListener("click", onClickCustomSelect, false);
juliandoucette 2017/08/22 14:33:41 NIT: We could handle this event on the body instea
ire 2017/09/04 20:28:06 Agreed. I would like to change the way both this a
juliandoucette 2017/09/06 17:48:19 Acknowledged.
+ }
+
+ }, false);
+}());

Powered by Google App Engine
This is Rietveld