Implemented Chevron Icon instead of "Click to Expand", Plugins tab, #325

This commit is contained in:
Rsl1122 2017-10-08 13:15:17 +03:00
parent fa7503cd57
commit 984f982a35
2 changed files with 16 additions and 7 deletions

View File

@ -211,9 +211,9 @@ public class HtmlStructure {
.append("<div class=\"row\">")
.append("<div class=\"column\">")
.append("<div class=\"box-header\">")
.append("<h2><i class=\"fa fa-server\" aria-hidden=\"true\"></i> ")
.append("<h2><i style=\"padding: 8px;\" class=\"fa fa-chevron-down\" aria-hidden=\"true\"></i> ")
.append(serverName)
.append("</h2><p>Click to Expand</p>")
.append(" <i class=\"fa fa-server\" aria-hidden=\"true\"></i></h2>")
.append("</div>")
.append("</div>")
.append("</div>")

View File

@ -1,8 +1,17 @@
$(".plugins-header").click(function () {
var $header = $(this);
var $content = $header.next();
$header = $(this);
$content = $header.next();
$(this).parent().siblings().children().next().slideUp(500);
$content.slideToggle(500, function () {
//execute this after slideToggle is done
});
$header.html(function(i, origText) {
$(".plugins-header").html(function(i, origText) {
return origText.replace("fa-chevron-up", "fa-chevron-down")
});
if (origText.includes("fa-chevron-down")) {
return origText.replace("fa-chevron-down", "fa-chevron-up")
} else {
return origText.replace("fa-chevron-up", "fa-chevron-down")
}
});
$content.slideToggle(500);
});