aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-01-05 08:22:27 -0800
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-01-05 08:22:27 -0800
commitfada87e916dd50eb6766cac919de41f0be2a12bc (patch)
tree170b4a764446caafc58b67e37e3bd1d969646a05
parent0aadca2d8392c197cbda45188b461d6d686ca24e (diff)
parent434d9cbd8649ce0d0be53669bf595c00771195e2 (diff)
downloadrails-fada87e916dd50eb6766cac919de41f0be2a12bc.tar.gz
rails-fada87e916dd50eb6766cac919de41f0be2a12bc.tar.bz2
rails-fada87e916dd50eb6766cac919de41f0be2a12bc.zip
Merge pull request #8768 from goshakkk/about-env-toggling
Allow toggling "about app's env", not just showing
-rw-r--r--railties/lib/rails/templates/rails/welcome/index.html.erb18
1 files changed, 11 insertions, 7 deletions
diff --git a/railties/lib/rails/templates/rails/welcome/index.html.erb b/railties/lib/rails/templates/rails/welcome/index.html.erb
index 8ddec1b2a3..17174e72c0 100644
--- a/railties/lib/rails/templates/rails/welcome/index.html.erb
+++ b/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>