BigW Consortium Gitlab

Commit a7a1a604 by Filipa Lacerda

Target all build links inside a dropdown. Use jQuery to handle event delegation.

parent 12a0d5a2
......@@ -287,7 +287,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
MergeRequestWidget.prototype.initMiniPipelineGraph = function() {
new MiniPipelineGraph({
container: '.js-pipeline-inline-mr-widget-graph',
container: '.js-pipeline-inline-mr-widget-graph:visible',
}).bindEvents();
};
......
......@@ -40,9 +40,13 @@ export default class MiniPipelineGraph {
* target the click event of this component.
*/
stopDropdownClickPropagation() {
document.querySelector(`${this.container} .js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item`).addEventListener('click', (e) => {
$(document).on(
'click',
`${this.container} .js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item`,
(e) => {
e.stopPropagation();
});
},
);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment