Skip to content
Snippets Groups Projects
Commit 398fe8ae authored by D4rkHeart's avatar D4rkHeart
Browse files

[Refactor] As per MR, we can now double click anywhere

- Right click has now no effect on the application oppening
- used the @nborboen solution
parent 210fb74c
No related branches found
No related tags found
1 merge request!24[Feat] Open application in a new tab
......@@ -30,23 +30,19 @@
>
<template v-slot:items="props">
<span></span>
<tr>
<td
v-if="$store.getters['moduleUser/userIsResponsible']"
:class="{ isNew: isNew(props.item.fk_status, props.item.applicant_application_date) }"
>
<tr
@click="handleClick(props.item.applicant_id, $event)"
@dblclick="handleDoubleClick(props.item.applicant_id)"
@contextmenu.prevent="handleContextMenu(props.item.applicant_id, $event)"
:class="{ isNew: isNew(props.item.fk_status, props.item.applicant_application_date) && !$store.getters['moduleUser/userIsResponsible'] }"
>
<td>
<v-checkbox v-model="props.selected" hide-details color="primary"></v-checkbox>
</td>
<td
@mousedown="consultApplication(props.item.applicant_id, $event)"
:class="{ isNew: isNew(props.item.fk_status, props.item.applicant_application_date) && !$store.getters['moduleUser/userIsResponsible'] }"
>
<v-tooltip bottom class="mr-2">
<template v-slot:activator="{ on }">
<v-icon big @click="navigateTo(props.item.applicant_id)" v-on="on">pageview</v-icon>
</template>
<span>Consulter</span>
</v-tooltip>
<td>
<router-link :to="{ name: 'application', params: { id: props.item.applicant_id } }" v-on="on">
<v-icon big>pageview</v-icon>
</router-link>
</td>
<td>{{ props.item.applicant_name }} {{ props.item.applicant_fsname }}</td>
<td>{{ props.item.job_full_value }}</td>
......@@ -239,17 +235,28 @@ export default {
return [...items].sort(descending ? compareFunction : compareFunctionReversed);
},
consultApplication(id, event) {
if (event.ctrlKey || event.button === 1) {
const newTab = window.open('/gest/#/application/' + id, '_blank');
handleClick(id, event) {
const route = { name: 'application', params: { id: id } };
// Check for middle click
if (event.button === 1) {
const newTab = window.open(this.$router.resolve(route).href, '_blank');
if (newTab) {
newTab.focus();
}
event.preventDefault();
} else {
this.$router.push('/application/' + id);
}
},
handleDoubleClick(id) {
const route = { name: 'application', params: { id: id } };
const newTab = window.open(this.$router.resolve(route).href, '_blank');
if (newTab) {
newTab.focus();
}
},
handleContextMenu(id, event) {
event.preventDefault();
},
},
components: {
ApplicationsFilters,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment