diff options
author | Gosha Arinich <me@goshakkk.name> | 2013-01-05 19:13:14 +0300 |
---|---|---|
committer | Gosha Arinich <me@goshakkk.name> | 2013-01-05 19:15:09 +0300 |
commit | 434d9cbd8649ce0d0be53669bf595c00771195e2 (patch) | |
tree | 170b4a764446caafc58b67e37e3bd1d969646a05 /railties/lib | |
parent | 0aadca2d8392c197cbda45188b461d6d686ca24e (diff) | |
download | rails-434d9cbd8649ce0d0be53669bf595c00771195e2.tar.gz rails-434d9cbd8649ce0d0be53669bf595c00771195e2.tar.bz2 rails-434d9cbd8649ce0d0be53669bf595c00771195e2.zip |
allow toggling about env, not just showing
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/templates/rails/welcome/index.html.erb | 18 |
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> |