From 541998da39ffb755fca4edabee4fe2fbdb2f751c Mon Sep 17 00:00:00 2001 From: Robert Lord Date: Mon, 23 Sep 2013 12:06:39 -0700 Subject: [PATCH] Change code buttons to refresh the page with the language name after the ? in the url This commit has two benefits: - Now, copying the URL will actually copy the current language as well. You don't need to think to add a language - If a language moves objects on the page down, the tocify header location cache will not be invalid, since it is generated on page load. Therefore, if code moves some elements down, since the page is reloaded, the cache will also be regenerated, to reflect the real locations of the headers. --- source/javascripts/lang_selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/javascripts/lang_selector.js b/source/javascripts/lang_selector.js index 327b67c..09f4621 100644 --- a/source/javascripts/lang_selector.js +++ b/source/javascripts/lang_selector.js @@ -19,7 +19,7 @@ function setupLanguages(l) { } $("#lang-selector a").bind("click", function() { - activateLanguage($(this).data("language-name")); + window.location.replace("?" + $(this).data("language-name") + window.location.hash); return false; });