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: Created July 13, 2017, 7:57 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
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() {
+
+ // 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);
+ }
+
+ }, false);
+}());
« no previous file with comments | « settings.ini ('k') | static/scss/base/_reset.scss » ('j') | static/scss/layout/_footer.scss » ('J')

Powered by Google App Engine
This is Rietveld