2016-08-17 21:41:24 +00:00
|
|
|
(function() {
|
|
|
|
function toggleGraph() {
|
|
|
|
const $pipelineBtn = $(this).closest('.toggle-pipeline-btn');
|
|
|
|
const $pipelineGraph = $(this).closest('.row-content-block').next('.pipeline-graph');
|
|
|
|
const $btnText = $(this).find('.toggle-btn-text');
|
2016-08-23 16:02:52 +00:00
|
|
|
const $icon = $(this).find('.fa');
|
2016-08-17 00:42:05 +00:00
|
|
|
|
2016-08-17 21:41:24 +00:00
|
|
|
$($pipelineBtn).add($pipelineGraph).toggleClass('graph-collapsed');
|
2016-08-17 15:06:10 +00:00
|
|
|
|
2016-08-17 21:41:24 +00:00
|
|
|
const graphCollapsed = $pipelineGraph.hasClass('graph-collapsed');
|
2016-08-23 16:02:52 +00:00
|
|
|
const expandIcon = 'fa-caret-down';
|
|
|
|
const hideIcon = 'fa-caret-up';
|
2016-08-17 00:42:05 +00:00
|
|
|
|
2016-08-23 16:02:52 +00:00
|
|
|
if(graphCollapsed) {
|
|
|
|
$btnText.text('Expand');
|
|
|
|
$icon.removeClass(hideIcon).addClass(expandIcon);
|
|
|
|
} else {
|
|
|
|
$btnText.text('Hide');
|
|
|
|
$icon.removeClass(expandIcon).addClass(hideIcon);
|
|
|
|
}
|
2016-08-17 21:41:24 +00:00
|
|
|
}
|
2016-08-17 00:42:05 +00:00
|
|
|
|
2016-08-17 21:41:24 +00:00
|
|
|
$(document).on('click', '.toggle-pipeline-btn', toggleGraph);
|
|
|
|
})();
|