Fix getting back to the default task view when navigating back from a task modal
This commit is contained in:
parent
d7112c99c7
commit
eb31798f06
2 changed files with 15 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="{ 'is-loading': taskService.loading}" class="loader-container task-view-container">
|
<div :class="{ 'is-loading': taskService.loading}" class="loader-container task-view-container">
|
||||||
<div class="task-view">
|
<div class="task-view">
|
||||||
<heading v-model="task" :can-write="canWrite"/>
|
<heading v-model="task" :can-write="canWrite" ref="heading"/>
|
||||||
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
|
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
|
||||||
{{ parent.namespace.title }} >
|
{{ parent.namespace.title }} >
|
||||||
<router-link :to="{ name: listViewName, params: { listId: parent.list.id } }">
|
<router-link :to="{ name: listViewName, params: { listId: parent.list.id } }">
|
||||||
|
@ -499,6 +499,12 @@ export default {
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
this.error(e, this)
|
this.error(e, this)
|
||||||
})
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.scrollToHeading()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
scrollToHeading() {
|
||||||
|
this.$refs.heading.$el.scrollIntoView({block: 'center'})
|
||||||
},
|
},
|
||||||
setActiveFields() {
|
setActiveFields() {
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,14 @@ export default {
|
||||||
vm.lastRoute = from
|
vm.lastRoute = from
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
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()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
if (this.lastRoute === null) {
|
if (this.lastRoute === null) {
|
||||||
|
|
Loading…
Reference in a new issue