/* This file contains the method for shrinking and expanding the collapsable sections */ $(".collapse").click(function () { if ($(this).html() == "-") { $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeOut(); $(this).html("+"); } else { $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeIn(); $(this).html("-"); } }); /* Because some chart sections are created on the fly adding an event listener was impossible. Therefore this function is hardcoded as an HTML onclick event for the dynamically created buttons of these sections */ function CollapseSection(caller) { var jqCaller = $(caller); if (jqCaller.html() == "-") { jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeOut(); jqCaller.html("+"); } else { jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeIn(); jqCaller.html("-"); } } /* Passed the interior div this fucntion is used to create an automatically collapsed section */ function CollapsedByDefault(caller) { $(caller).parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").hide(); } /* Used when scrolling to a task by error, opens the container before task is scrolled to */ function OpenOnError(caller) { var jqCaller = $(caller); jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeIn(); jqCaller.parent().children("button").html("-"); } /* Because some chart sections are collapsed(display=none) on resize the charts will not chart properly unless they are opened, them updated, then closed again. */ function ResizeOpenClose(caller) { var jqCaller = $(caller); if (jqCaller.html() == "-") { jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table, select").hide(); jqCaller.html("+"); } else { jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table, select").show(); jqCaller.html("-"); } } /* Because some chart sections are collapsed(display=none) on resize the charts will not chart properly unless they are opened, them updated, then closed again. */ function ResizeOpenCloseTabular(caller) { var jqCaller = $(caller); if (jqCaller.css("display") != "none") { jqCaller.hide(); } else { jqCaller.show(); } }