summaryrefslogtreecommitdiffhomepage
path: root/plugins/webbox/html
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-15 10:54:09 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-15 10:54:09 +0200
commit10e77782b117600abfc7e8619f190af6b05ecdeb (patch)
treeaa0629929eeaac0b2677c1bba4b6804c92790a05 /plugins/webbox/html
parent7b87cf906173011fe98155c403a77d6330fa39af (diff)
Webbox: Added root link to navigation
Diffstat (limited to 'plugins/webbox/html')
-rw-r--r--plugins/webbox/html/webbox.js10
1 files changed, 9 insertions, 1 deletions
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 "<span class=\"link\" onclick=\"setCurrentDir('/')\">" + rootDir + "</span>";
+ }
+
+ 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) {