From 2ceb7cf706d7cb32f3ba094f5594d988a2e37c4d Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 26 Jan 2022 18:04:37 +0100 Subject: [PATCH] Make back navigation work with history, to preserve scroll position --- client/src/pages/createContentBlock.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/pages/createContentBlock.vue b/client/src/pages/createContentBlock.vue index 9721fab6..ea2c1ca1 100644 --- a/client/src/pages/createContentBlock.vue +++ b/client/src/pages/createContentBlock.vue @@ -72,7 +72,10 @@ class="button button--primary" @click="save(contentBlock)" >Speichern - Abbrechen + Abbrechen @@ -89,6 +92,7 @@ import NEW_CONTENT_BLOCK_MUTATION from '@/graphql/gql/mutations/addContentBlock.gql'; import {setUserBlockType} from '@/helpers/content-block'; import MODULE_DETAILS_QUERY from '@/graphql/gql/queries/modules/moduleDetailsQuery.gql'; + import {MODULE_PAGE} from '@/router/module.names'; export default Vue.extend({ props: { @@ -235,7 +239,10 @@ slug } }] - }); + }).then(this.goToModule); + }, + goToModule() { + this.$router.go(-1); } }, });