gitlab-org--gitlab-foss/app/assets/javascripts/pipeline.js.es6

16 lines
542 B
JavaScript
Raw Normal View History

2016-08-17 17:41:24 -04: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-17 17:41:24 -04:00
$($pipelineBtn).add($pipelineGraph).toggleClass('graph-collapsed');
2016-08-17 17:41:24 -04:00
const graphCollapsed = $pipelineGraph.hasClass('graph-collapsed');
2016-08-17 17:41:24 -04:00
graphCollapsed ? $btnText.text('Expand') : $btnText.text('Hide')
}
2016-08-17 17:41:24 -04:00
$(document).on('click', '.toggle-pipeline-btn', toggleGraph);
})();