diff options
Diffstat (limited to 'fg21sim/webui/static/js')
-rw-r--r-- | fg21sim/webui/static/js/main.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fg21sim/webui/static/js/main.js b/fg21sim/webui/static/js/main.js index 25bc12d..7f5b582 100644 --- a/fg21sim/webui/static/js/main.js +++ b/fg21sim/webui/static/js/main.js @@ -82,4 +82,21 @@ $(document).ready(function () { var nav_height = $("nav.navigation").outerHeight(); scrollTarget(nav_height); }); + + // Panel toggle control + $(".panel-title > .toggle").on("click", function () { + var toggle = $(this); + var body = toggle.closest(".panel").find(".panel-body"); + if (body.is(":visible")) { + body.slideUp("fast"); + toggle.removeClass("fa-chevron-circle-up") + .addClass("fa-chevron-circle-down") + .attr("title", "Expand contents"); + } else { + body.slideDown("fast"); + toggle.removeClass("fa-chevron-circle-down") + .addClass("fa-chevron-circle-up") + .attr("title", "Collapse contents"); + } + }); }); |