Stops propagation for dropdown content in pipeline graph. Applies the same behavior of the mini graph

This commit is contained in:
Filipa Lacerda 2017-08-14 14:52:04 +01:00
parent 56054c3f9c
commit f01e34df3f
2 changed files with 26 additions and 0 deletions

View File

@ -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>

View File

@ -0,0 +1,5 @@
---
title: Prevents jobs dropdown from closing in pipeline graph
merge_request:
author:
type: fixed