2016-08-17 17:41:24 -04:00
|
|
|
(function() {
|
2016-09-12 06:19:20 -04:00
|
|
|
|
|
|
|
function addMarginToBuild () {
|
2016-09-14 07:51:36 -04:00
|
|
|
const $secondChildBuildNode = $('.build:nth-child(2)');
|
|
|
|
const $firstChildBuildNode = $secondChildBuildNode.prev('.build');
|
|
|
|
// const $previousBuildColumn = $secondChildBuildNode.closest('.stage-column').prev('.stage-column');
|
|
|
|
if ($secondChildBuildNode.length) {
|
|
|
|
$secondChildBuildNode.closest('.stage-column').addClass('left-margin');
|
|
|
|
$firstChildBuildNode.addClass('left-connector');
|
2016-09-12 06:19:20 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-17 17:41:24 -04:00
|
|
|
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 12:02:52 -04:00
|
|
|
const $icon = $(this).find('.fa');
|
2016-08-16 20:42:05 -04:00
|
|
|
|
2016-08-17 17:41:24 -04:00
|
|
|
$($pipelineBtn).add($pipelineGraph).toggleClass('graph-collapsed');
|
2016-08-17 11:06:10 -04:00
|
|
|
|
2016-08-17 17:41:24 -04:00
|
|
|
const graphCollapsed = $pipelineGraph.hasClass('graph-collapsed');
|
2016-08-23 12:02:52 -04:00
|
|
|
const expandIcon = 'fa-caret-down';
|
|
|
|
const hideIcon = 'fa-caret-up';
|
2016-08-16 20:42:05 -04:00
|
|
|
|
2016-08-23 12:02:52 -04:00
|
|
|
if(graphCollapsed) {
|
|
|
|
$btnText.text('Expand');
|
|
|
|
$icon.removeClass(hideIcon).addClass(expandIcon);
|
|
|
|
} else {
|
|
|
|
$btnText.text('Hide');
|
|
|
|
$icon.removeClass(expandIcon).addClass(hideIcon);
|
|
|
|
}
|
2016-08-17 17:41:24 -04:00
|
|
|
}
|
2016-08-16 20:42:05 -04:00
|
|
|
|
2016-08-17 17:41:24 -04:00
|
|
|
$(document).on('click', '.toggle-pipeline-btn', toggleGraph);
|
2016-09-12 06:19:20 -04:00
|
|
|
$(document).on('ready', addMarginToBuild);
|
2016-08-17 17:41:24 -04:00
|
|
|
})();
|