Skip to content

Commit 2bec9f7

Browse files
committed
Use hash so that if we refresh we get back to the same page
1 parent 83a9724 commit 2bec9f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/main.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function init(){
5252
path = path + "/";
5353
}
5454
chroot = path;
55-
55+
if (0 != window.location.hash.length){
56+
path += window.location.hash.slice(2)
57+
}
5658
display(path);
5759
},
5860
dataType:"json"
@@ -91,6 +93,7 @@ function display(path){
9193
{
9294
path = "/";
9395
}
96+
window.location = "#" + path.slice(chroot.length-1);
9497
display(path);
9598
}.bind(path)
9699
);
@@ -117,6 +120,7 @@ function display(path){
117120
if (this.subFolder && this.subFolder.hasOwnProperty("index.html")){
118121
window.open(this.subFolder["index.html"].url);
119122
}else{
123+
window.location = "#" + path.slice(chroot.length-1);
120124
display(path);
121125
}
122126
}.bind(element, element_path);

0 commit comments

Comments
 (0)