Stops propagation for dropdown content in pipeline graph. Applies the same behavior of the mini graph
This commit is contained in:
parent
56054c3f9c
commit
f01e34df3f
|
@ -48,6 +48,27 @@
|
|||
return `${this.job.name} - ${this.job.status.label}`;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* When the user right clicks or cmd/ctrl + click in the job name
|
||||
* the dropdown should not be closed and the link should open in another tab,
|
||||
* so we stop propagation of the click event inside the dropdown.
|
||||
*
|
||||
* Since this component is rendered multiple times per page we need to guarantee we only
|
||||
* target the click event of this component.
|
||||
*/
|
||||
stopDropdownClickPropagation() {
|
||||
$(this.$el.querySelectorAll('.js-grouped-pipeline-dropdown a.mini-pipeline-graph-dropdown-item'))
|
||||
.on('click', (e) => {
|
||||
e.stopPropagation();
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.stopDropdownClickPropagation();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Prevents jobs dropdown from closing in pipeline graph
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
Loading…
Reference in New Issue