From 0e5675ffee7d02a8f06738b56fbced7a677e9e44 Mon Sep 17 00:00:00 2001 From: Amber Dev Date: Fri, 10 Jul 2020 01:45:05 +0530 Subject: [PATCH] added chapter navigation --- src/pages/Dashboard/ChapterInfo.vue | 46 ++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/src/pages/Dashboard/ChapterInfo.vue b/src/pages/Dashboard/ChapterInfo.vue index 01546c2..0dbe5d9 100644 --- a/src/pages/Dashboard/ChapterInfo.vue +++ b/src/pages/Dashboard/ChapterInfo.vue @@ -47,17 +47,30 @@ - - - + + + + + chevron_left + {{chapterNames[indexSelectedChapter - 1]}} + + + + {{chapterNames[indexSelectedChapter + 1]}} chevron_right - - + + @@ -109,10 +122,17 @@ export default { }; }, methods: { - showSelectedChapter() { - this.indexSelectedChapter += 1; - this.selectedChapterId = this.chapterIds[this.indexSelectedChapter]; - this.getParticularChapterDetail(); + showSelectedChapter(newChapter) { + if (newChapter == "forward") { + this.indexSelectedChapter += 1; + this.selectedChapterId = this.chapterIds[this.indexSelectedChapter]; + this.getParticularChapterDetail(); + } + if (newChapter == "back") { + this.indexSelectedChapter -= 1; + this.selectedChapterId = this.chapterIds[this.indexSelectedChapter]; + this.getParticularChapterDetail(); + } }, getParticularChapterDetail() { http() -- 2.0.0