Добавил allowUrlParamBookPos

This commit is contained in:
Book Pauk
2019-01-24 01:29:45 +07:00
parent 2e469bd267
commit 3ccfec1baa

View File

@@ -97,6 +97,7 @@ class Reader extends Vue {
loaderActive = false; loaderActive = false;
progressActive = false; progressActive = false;
bookPos = null; bookPos = null;
allowUrlParamBookPos = true;
created() { created() {
this.commit = this.$store.commit; this.commit = this.$store.commit;
@@ -136,11 +137,12 @@ class Reader extends Vue {
} }
updateRoute(isNewRoute) { updateRoute(isNewRoute) {
const pos = (this.bookPos != undefined ? `__p=${this.bookPos}&` : ''); const pos = (this.bookPos != undefined && this.allowUrlParamBookPos ? `__p=${this.bookPos}&` : '');
if (isNewRoute) if (isNewRoute)
this.$router.push(`/reader?${pos}url=${this.lastOpenedBook.url}`); this.$router.push(`/reader?${pos}url=${this.lastOpenedBook.url}`);
else else
this.$router.replace(`/reader?${pos}url=${this.lastOpenedBook.url}`); this.$router.replace(`/reader?${pos}url=${this.lastOpenedBook.url}`);
} }
get routeParamUrl() { get routeParamUrl() {