Commit a7a1a604 authored by Filipa Lacerda's avatar 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'; ...@@ -287,7 +287,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
MergeRequestWidget.prototype.initMiniPipelineGraph = function() { MergeRequestWidget.prototype.initMiniPipelineGraph = function() {
new MiniPipelineGraph({ new MiniPipelineGraph({
container: '.js-pipeline-inline-mr-widget-graph', container: '.js-pipeline-inline-mr-widget-graph:visible',
}).bindEvents(); }).bindEvents();
}; };
......
...@@ -40,9 +40,13 @@ export default class MiniPipelineGraph { ...@@ -40,9 +40,13 @@ export default class MiniPipelineGraph {
* target the click event of this component. * target the click event of this component.
*/ */
stopDropdownClickPropagation() { 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(); 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