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: Remove langnames commit, use website-default breakpoint variables Created Sept. 18, 2017, 3:09 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
===================================================================
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -18,10 +18,36 @@
var toggleNavbarCollapseEls = document.getElementsByClassName("toggle-navbar-collapse");
for (var i = 0; i < toggleNavbarCollapseEls.length; i++)
{
toggleNavbarCollapseEls[i]
.addEventListener("click", toggleNavbarCollapse, false);
}
+ // Custom Select
+ function onClickCustomSelect()
+ {
+ var options = this.nextElementSibling;
+ if (options.getAttribute("aria-hidden") == "true")
+ {
+ options.removeAttribute("aria-hidden");
+ this.setAttribute("aria-expanded", "true");
+ }
+ else
+ {
+ options.setAttribute("aria-hidden", "true");
+ this.setAttribute("aria-expanded", "false");
+ }
+ }
+
+ var customSelectEls = document.getElementsByClassName('custom-select-selected');
+ for (var i = 0; i < customSelectEls.length; i++)
+ {
+ customSelectEls[i]
+ .addEventListener("click", onClickCustomSelect, false);
+ customSelectEls[i]
+ .nextElementSibling
+ .setAttribute("aria-hidden", "true");
+ }
+
}, false);
}());

Powered by Google App Engine
This is Rietveld