From 663ef8ebf9aee1e06086af1e326bf0386c7b3acb Mon Sep 17 00:00:00 2001 From: Roman Gräf Date: Wed, 1 Nov 2017 13:43:26 +0100 Subject: Update default.js --- res/default.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/res/default.js b/res/default.js index 5fd0956..087e6c2 100644 --- a/res/default.js +++ b/res/default.js @@ -19,14 +19,6 @@ function load(file, title) { }, "text"); } -var contentid = 0; -var contents = []; - -function load_content(id){ - sidebar_close(); - load(contents[id].url, contents[id].name); -} - function onload() { $.getJSON("content/content.json", function(data){ var el = $("#sidebar")[0]; @@ -42,10 +34,11 @@ function onload() { atag.onclick = "sidebar_close()"; } if(load=="content"){ - contents[contentid] = item; atag.href = "#"; - atag.onclick = "load_content("+contentid+")"; - contentid++; + atag.onclick = function(){ + sidebar_close(); + load(item.url, item.name); + }; } var texttag = document.createTextNode(name); if(img) { -- cgit