Make back navigation work with history, to preserve scroll position

This commit is contained in:
Ramon Wenger 2022-01-26 18:04:37 +01:00
parent b2d0c4922a
commit 2ceb7cf706
1 changed files with 9 additions and 2 deletions

View File

@ -72,7 +72,10 @@
class="button button--primary" class="button button--primary"
@click="save(contentBlock)" @click="save(contentBlock)"
>Speichern</a> >Speichern</a>
<a class="button">Abbrechen</a> <a
class="button"
@click="goToModule"
>Abbrechen</a>
</footer> </footer>
</div> </div>
</div> </div>
@ -89,6 +92,7 @@
import NEW_CONTENT_BLOCK_MUTATION from '@/graphql/gql/mutations/addContentBlock.gql'; import NEW_CONTENT_BLOCK_MUTATION from '@/graphql/gql/mutations/addContentBlock.gql';
import {setUserBlockType} from '@/helpers/content-block'; import {setUserBlockType} from '@/helpers/content-block';
import MODULE_DETAILS_QUERY from '@/graphql/gql/queries/modules/moduleDetailsQuery.gql'; import MODULE_DETAILS_QUERY from '@/graphql/gql/queries/modules/moduleDetailsQuery.gql';
import {MODULE_PAGE} from '@/router/module.names';
export default Vue.extend({ export default Vue.extend({
props: { props: {
@ -235,7 +239,10 @@
slug slug
} }
}] }]
}); }).then(this.goToModule);
},
goToModule() {
this.$router.go(-1);
} }
}, },
}); });