switch to a dropdown menu on file tree

This commit is contained in:
Zlatin Balevsky
2020-03-20 15:59:54 +00:00
parent 2a4db868aa
commit f8bbeb8ac0
2 changed files with 36 additions and 2 deletions

View File

@ -487,4 +487,33 @@ li.fileTree {
max-height: 0;
overflow: hidden;
transition: max-height: 0.2s ease-out;
}
}
.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;}

View File

@ -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 = "<a href='/MuWire/DownloadedContent/" + this.infoHash + "'>" + this.path + "</a>"
var html = "<li class='fileTree'>" + nameLink
html += "<div class='right'>" + unshareLink + " " + commentLink + " " + certifyLink + " " + certified + " " + publish.render() +"</div>"
html += "<div class='right'>" + certified + " " + published + " <div class='dropdown'><a class='droplink' href='#'>" + _t("Actions")+ "</a><div class='dropdown-content'>"
html += unshareLink + commentLink + certifyLink + publish.render()
html += "</div></div></div>"
html += "<div class='centercomment' id='comment-" + this.nodeId + "'></div>"
html += "</li>"