diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-08-14 16:52:04 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-08-14 16:53:47 +0300 |
commit | f01e34df3ffc4e38c51b23c0c62b04d25c7b3696 (patch) | |
tree | 21afb85ca5843fc08d44914d3e1bed2cb1d1f26b /app/assets/javascripts/pipelines | |
parent | 56054c3f9c3c78deddcd5cee7a89336efa225a38 (diff) |
Stops propagation for dropdown content in pipeline graph. Applies the same behavior of the mini graph
Diffstat (limited to 'app/assets/javascripts/pipelines')
-rw-r--r-- | app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue b/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue index 2944689a5a7..7695b04db74 100644 --- a/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue @@ -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> |