From c5b1d6d530f50a2b86b39f18dd22d248f1dae9a7 Mon Sep 17 00:00:00 2001 From: Roman Gräf Date: Mon, 6 Nov 2017 11:09:29 +0100 Subject: Update default.js --- res/default.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/res/default.js b/res/default.js index b5fd7cb..bdb87e4 100644 --- a/res/default.js +++ b/res/default.js @@ -36,7 +36,8 @@ function onload() { var url = item.url; var name = item.name; var img = item.img; - refs[item.id] = { + var id = item.id; + refs[id] = { name: name, url: url } @@ -47,7 +48,7 @@ function onload() { atag.onclick = sidebar_close; } if(load=="content"){ - atag.href = "#"; + atag.href = "#"+item.id; atag.onclick = function(){ sidebar_close(); window.load_(item.url, item.name); @@ -66,4 +67,8 @@ function onload() { }); el.lastChild.classList.add('sidebar-last'); }); + let tag = location.href.split("#"); + if(tag.length > 1){ + load(tag[1]); + } } -- cgit