Commit 541998da authored by Robert Lord's avatar Robert Lord

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.
parent bc79a655
......@@ -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;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment