diff options
-rwxr-xr-x | railties/guides/files/javascripts/guides.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/guides/files/javascripts/guides.js b/railties/guides/files/javascripts/guides.js index 81fc07e799..14bad4beb9 100755 --- a/railties/guides/files/javascripts/guides.js +++ b/railties/guides/files/javascripts/guides.js @@ -1,8 +1,17 @@ function guideMenu(){ - if (document.getElementById('guides').style.display == "none") { document.getElementById('guides').style.display = "block"; } else { document.getElementById('guides').style.display = "none"; } } + +// Fix Copy+Paste of Code blocks in Firefox 3 +if ( window.addEventListener && document.getElementsByClassName ) { + window.addEventListener('load', function() { + var list = document.getElementsByClassName('code_container'); + for (var i=0, len=list.length; i<len; i++) { + list[i].innerHTML = list[i].innerHTML.replace(/\n/g, '<br />'); + } + }, false); +} |