From fea49904069b7d634c4ed12bbea741662bd94a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=83=D8=A7=D8=B1=D9=84=20=D9=85=D8=A8=D8=A7=D8=B1=D9=83?= Date: Thu, 15 Jul 2021 16:29:16 +0200 Subject: [PATCH] table of contents, an letting og of expand/colapse chapters --- front/src/App.vue | 18 +++++++------ front/src/components/Content/Chapter.vue | 21 +++++---------- front/src/components/Content/index.vue | 34 +++++++++++++++++++----- 3 files changed, 43 insertions(+), 30 deletions(-) diff --git a/front/src/App.vue b/front/src/App.vue index ac4a89e..e6e5721 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -46,14 +46,16 @@ export default { } }) - this.$router.afterEach((to) => { - this.$store.commit("setTopics", []); - this.$store.commit("setRules", []); - this.$store.commit("setCurStream", to.path.replace("/", "")); - if (this.currentStream != "" - && this.streams.find(s => s.name == this.currentStream) - ) { - this.setUpDoc(this.currentStream); + this.$router.afterEach((to, from) => { + if (to.path !== from.path) { + this.$store.commit("setTopics", []); + this.$store.commit("setRules", []); + this.$store.commit("setCurStream", to.path.replace("/", "")); + if (this.currentStream != "" + && this.streams.find(s => s.name == this.currentStream) + ) { + this.setUpDoc(this.currentStream); + } } }); }, diff --git a/front/src/components/Content/Chapter.vue b/front/src/components/Content/Chapter.vue index 45ecbfd..32c1d89 100644 --- a/front/src/components/Content/Chapter.vue +++ b/front/src/components/Content/Chapter.vue @@ -1,10 +1,9 @@