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

31 lines
1.2 KiB
JavaScript
Raw Normal View History

/* eslint-disable */
2016-09-29 17:24:37 -04:00
((global) => {
class Pipelines {
constructor() {
this.addMarginToBuildColumns();
}
2016-09-29 17:24:37 -04:00
addMarginToBuildColumns() {
this.pipelineGraph = document.querySelector('.pipeline-graph');
const secondChildBuildNodes = document.querySelector('.pipeline-graph').querySelectorAll('.build:nth-child(2)');
2016-10-20 17:18:39 -04:00
for (buildNodeIndex in secondChildBuildNodes) {
const buildNode = secondChildBuildNodes[buildNodeIndex];
const firstChildBuildNode = buildNode.previousElementSibling;
if (!firstChildBuildNode || !firstChildBuildNode.matches('.build')) continue;
const multiBuildColumn = buildNode.closest('.stage-column');
const previousColumn = multiBuildColumn.previousElementSibling;
if (!previousColumn || !previousColumn.matches('.stage-column')) continue;
multiBuildColumn.classList.add('left-margin');
firstChildBuildNode.classList.add('left-connector');
const columnBuilds = previousColumn.querySelectorAll('.build');
if (columnBuilds.length === 1) previousColumn.classList.add('no-margin');
2016-09-29 17:24:37 -04:00
}
this.pipelineGraph.classList.remove('hidden');
}
2016-08-17 17:41:24 -04:00
}
2016-09-29 17:24:37 -04:00
global.Pipelines = Pipelines;
})(window.gl || (window.gl = {}));