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.
This commit is contained in:
Robert Lord
2013-09-23 12:06:39 -07:00
parent bc79a655e5
commit 541998da39

View File

@@ -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;
});