Permalink
Browse files

allow toggling about env, not just showing

  • Loading branch information...
1 parent 0aadca2 commit 434d9cbd8649ce0d0be53669bf595c00771195e2 @goshakkk goshakkk committed Jan 5, 2013
Showing with 11 additions and 7 deletions.
  1. +11 −7 railties/lib/rails/templates/rails/welcome/index.html.erb
@@ -173,13 +173,17 @@
</style>
<script>
function about() {
- var info = document.getElementById('about-content'),
- xhr = new XMLHttpRequest();
- xhr.open("GET", "rails/info/properties", false);
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- xhr.send("");
- info.innerHTML = xhr.responseText;
- info.style.display = 'block'
+ var info = document.getElementById('about-content');
+
+ if (info.innerHTML == '') {
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", "rails/info/properties", false);
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ xhr.send("");
+ info.innerHTML = xhr.responseText;
+ }
+
+ info.style.display = info.style.display == 'none' ? 'block' : 'none';
}
</script>
</head>

0 comments on commit 434d9cb

Please sign in to comment.