mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2024-11-25 00:58:05 -05:00
Preserve history when linking
This commit is contained in:
parent
e7e49e070c
commit
0c04d14964
1 changed files with 6 additions and 1 deletions
|
@ -129,7 +129,12 @@ $("[data-action='load-url'] button").click(function(e) {
|
||||||
|
|
||||||
$("[data-staticlink]").click(function(e) {
|
$("[data-staticlink]").click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
showPage($(this).attr("data-staticlink"));
|
var path = $(this).attr("data-staticlink");
|
||||||
|
showPage(path);
|
||||||
|
window.location.hash = $(this).attr('href');
|
||||||
|
if ($("body > main > article").has(path).length == 0) {
|
||||||
|
document.body.scrollTop = 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function showPage(path) {
|
function showPage(path) {
|
||||||
|
|
Loading…
Reference in a new issue