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

Unified Diff: anwiki/_override-static/global/global/js/index.js

Issue 10295007: Added "learn more" toggle and area for platform-specific content (Closed)
Patch Set: Hide "learn more" button if JavaScript disabled Created April 23, 2013, 9:15 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
« no previous file with comments | « anwiki/_override-static/global/global/css/noscript-desktop.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: anwiki/_override-static/global/global/js/index.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/anwiki/_override-static/global/global/js/index.js
@@ -0,0 +1,35 @@
+(function()
+{
+ var visibleTab;
+ var container;
+
+ window.toggleMore = function()
+ {
+ if (container.className == "hidden")
+ container.className = visibleTab || getDefaultTab();
+ else
+ container.className = "hidden";
+ }
+
+ window.showTab = function(button)
+ {
+ var id = button.id.substr(5);
+ container.className = id;
+ visibleTab = id;
+ }
+
+ function getDefaultTab()
+ {
+ var content = document.getElementById("content");
+ var ua = content.className.match(/ua\-([^\s]+)/);
+ visibleTab = ua && ua[1] || "firefox";
+ return visibleTab;
+ }
+
+ function init()
+ {
+ container = document.getElementById("more-container");
+ }
+
+ init();
+})();
« no previous file with comments | « anwiki/_override-static/global/global/css/noscript-desktop.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld