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

This commit is contained in:
Rsl1122 2017-10-08 13:09:29 +03:00
parent f8f0603951
commit fa7503cd57
2 changed files with 15 additions and 7 deletions

View File

@ -129,8 +129,7 @@ public class HtmlStructure {
html.append("<div class=\"session column\">")
.append("<div class=\"session-header\">")
.append("<div class=\"session-col\" style=\"width: 200%;\">")
.append("<h3>").append(dotSeparated).append("</h3>")
.append("<p>Click to Expand</p>")
.append("<h3><i style=\"color:#777\" class=\"fa fa-chevron-down\" aria-hidden=\"true\"></i> ").append(dotSeparated).append("</h3>")
.append("</div>")
.append("</div>");

View File

@ -1,8 +1,17 @@
$(".session-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) {
$(".session-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);
});