From 10e77782b117600abfc7e8619f190af6b05ecdeb Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 15 May 2020 10:54:09 +0200 Subject: Webbox: Added root link to navigation --- plugins/webbox/html/webbox.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/webbox/html/webbox.js b/plugins/webbox/html/webbox.js index b262f6f..839b93d 100644 --- a/plugins/webbox/html/webbox.js +++ b/plugins/webbox/html/webbox.js @@ -421,6 +421,14 @@ function addDirectoryLinks(path) { return result; } +function getRootLink() { + if (rootDir != "/") { + return "" + rootDir + ""; + } + + return ""; +} + function setCurrentDir(newDir) { if (newDir.endsWith("/")) { newDir = newDir.substr(0, newDir.length - 1); @@ -434,7 +442,7 @@ function setCurrentDir(newDir) { var menu = document.getElementsByClassName("menu")[0]; var firsttd = menu.getElementsByClassName("firsttd")[0]; - firsttd.innerHTML = addDirectoryLinks(newDir); + firsttd.innerHTML = getRootLink() + addDirectoryLinks(newDir); } function download(filename) { -- cgit v1.2.3