From f8bbeb8ac0bc8241f1f495b6e3a169d6043f098f Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 20 Mar 2020 15:59:54 +0000 Subject: [PATCH] switch to a dropdown menu on file tree --- webui/src/main/css/muwire.css | 31 ++++++++++++++++++++++++++++++- webui/src/main/js/files.js | 7 ++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/webui/src/main/css/muwire.css b/webui/src/main/css/muwire.css index 30e9727b..eaceea46 100644 --- a/webui/src/main/css/muwire.css +++ b/webui/src/main/css/muwire.css @@ -487,4 +487,33 @@ li.fileTree { max-height: 0; overflow: hidden; transition: max-height: 0.2s ease-out; -} \ No newline at end of file +} + +.droplink { + cursor : pointer; +} + +.dropdown { + position: relative; + display: inline-block; +} + +.dropdown-content { + display: none; + position: absolute; + z-index:1; + background: white; + padding-left: 20px; + +} + +.dropdown-content a { + color: black; + display: block; +} + +/* Change color of dropdown links on hover */ +.dropdown-content a:hover {background-color: #ddd;} + +/* Show the dropdown menu on hover */ +.dropdown:hover .dropdown-content {display: block;} \ No newline at end of file diff --git a/webui/src/main/js/files.js b/webui/src/main/js/files.js index bcf83824..e58ba467 100644 --- a/webui/src/main/js/files.js +++ b/webui/src/main/js/files.js @@ -34,15 +34,20 @@ class Node { if (this.certified == "true") certified = _t("Certified") var publish + var published if (this.published == "true") { publish = new Link(_t("Unpublish"), "unpublish", [this.nodeId]) + published = _t("Published") } else { publish = new Link(_t("Publish"), "publish", [this.nodeId]) + published = "" } var nameLink = "" + this.path + "" var html = "
  • " + nameLink - html += "
    " + unshareLink + " " + commentLink + " " + certifyLink + " " + certified + " " + publish.render() +"
    " + html += "
    " + certified + " " + published + "
    " html += "
    " html += "
  • "