fix(webreader): defaults to LTR and fix touch

This commit is contained in:
Gauthier Roebroeck 2020-03-03 12:10:54 +08:00
parent 4f5c14e87a
commit 2eae83f561

View file

@ -1,8 +1,8 @@
<template> <template>
<v-container class="ma-0 pa-0 full-height" fluid v-if="pages.length > 0" style="width: 100%;" <v-container class="ma-0 pa-0 full-height" fluid v-if="pages.length > 0" style="width: 100%;"
v-touch="{ v-touch="{
left: () => turnLeft(), left: () => turnRight(),
right: () => turnRight(), right: () => turnLeft(),
}" }"
> >
<div> <div>
@ -304,7 +304,7 @@ export default Vue.extend({
imageFits: Object.values(ImageFit), imageFits: Object.values(ImageFit),
fit: ImageFit.HEIGHT, fit: ImageFit.HEIGHT,
readingDirections: Object.values(ReadingDirection), readingDirections: Object.values(ReadingDirection),
readingDirection: ReadingDirection.RightToLeft, readingDirection: ReadingDirection.LeftToRight,
animations: true animations: true
} }
} }
@ -320,10 +320,20 @@ export default Vue.extend({
window.addEventListener('keydown', this.keyPressed) window.addEventListener('keydown', this.keyPressed)
this.setup(this.bookId, Number(this.$route.query.page)) this.setup(this.bookId, Number(this.$route.query.page))
this.loadFromCookie(cookieReadingDirection, (v) => { this.readingDirection = v }) this.loadFromCookie(cookieReadingDirection, (v) => {
this.loadFromCookie(cookieAnimations, (v) => { this.animations = (v === 'true') }) this.readingDirection = v
this.loadFromCookie(cookieDoublePages, (v) => { this.doublePages = (v === 'true') }) })
this.loadFromCookie(cookieFit, (v) => { if (v) { this.imageFit = v } }) this.loadFromCookie(cookieAnimations, (v) => {
this.animations = (v === 'true')
})
this.loadFromCookie(cookieDoublePages, (v) => {
this.doublePages = (v === 'true')
})
this.loadFromCookie(cookieFit, (v) => {
if (v) {
this.imageFit = v
}
})
}, },
destroyed () { destroyed () {
window.removeEventListener('keydown', this.keyPressed) window.removeEventListener('keydown', this.keyPressed)