2020-04-26 01:11:34 +02:00
|
|
|
<template>
|
|
|
|
<div class="modal-mask">
|
2021-04-18 16:14:46 +02:00
|
|
|
<div @mousedown.self="close()" class="modal-container">
|
2020-04-26 01:11:34 +02:00
|
|
|
<div class="scrolling-content">
|
|
|
|
<a @click="close()" class="close">
|
|
|
|
<icon icon="times"/>
|
|
|
|
</a>
|
2020-04-30 12:49:42 +02:00
|
|
|
<task-detail-view/>
|
2020-04-26 01:11:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02:00
|
|
|
import TaskDetailView from './TaskDetailView'
|
2020-04-26 01:11:34 +02:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'TaskDetailViewModal',
|
|
|
|
components: {
|
|
|
|
TaskDetailView,
|
|
|
|
},
|
2021-01-10 22:07:33 +01:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
lastRoute: null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
|
next(vm => {
|
|
|
|
vm.lastRoute = from
|
|
|
|
})
|
|
|
|
},
|
2021-01-10 22:37:43 +01:00
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
|
if (from.name === 'task.kanban.detail' && to.name === 'task.detail') {
|
|
|
|
this.$router.replace({name: 'task.kanban.detail', params: to.params})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
next()
|
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
methods: {
|
|
|
|
close() {
|
2021-01-10 22:07:33 +01:00
|
|
|
if (this.lastRoute === null) {
|
|
|
|
this.$router.back()
|
|
|
|
} else {
|
|
|
|
this.$router.push(this.lastRoute)
|
|
|
|
}
|
2020-04-26 01:11:34 +02:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
},
|
|
|
|
}
|
2020-04-26 01:11:34 +02:00
|
|
|
</script>
|