mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
feat(webreader): add setting to disable swipe navigation
useful for iOS users as pinch zoom works, but is broken with swipe
This commit is contained in:
parent
3586ea1426
commit
32170d4d69
1 changed files with 23 additions and 4 deletions
|
|
@ -2,10 +2,10 @@
|
||||||
<v-container class="ma-0 pa-0 full-height" fluid v-if="pages.length > 0"
|
<v-container class="ma-0 pa-0 full-height" fluid v-if="pages.length > 0"
|
||||||
:style="`width: 100%; background-color: ${backgroundColor}`"
|
:style="`width: 100%; background-color: ${backgroundColor}`"
|
||||||
v-touch="{
|
v-touch="{
|
||||||
left: () => turnRight(),
|
left: () => {if(swipe) {turnRight()}},
|
||||||
right: () => turnLeft(),
|
right: () => {if(swipe) {turnLeft()}},
|
||||||
up: () => verticalNext(),
|
up: () => {if(swipe) {verticalNext()}},
|
||||||
down: () => verticalPrev()
|
down: () => {if(swipe) {verticalPrev()}}
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -183,10 +183,15 @@
|
||||||
<settings-switch v-model="doublePages" label="Page Layout"
|
<settings-switch v-model="doublePages" label="Page Layout"
|
||||||
:status="`${ doublePages ? 'Double Pages' : 'Single Page'}`"></settings-switch>
|
:status="`${ doublePages ? 'Double Pages' : 'Single Page'}`"></settings-switch>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<settings-switch v-model="animations" label="Page Transitions"></settings-switch>
|
<settings-switch v-model="animations" label="Page Transitions"></settings-switch>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item>
|
||||||
|
<settings-switch v-model="swipe" label="Swipe navigation"></settings-switch>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<settings-select
|
<settings-select
|
||||||
:items="backgroundColors"
|
:items="backgroundColors"
|
||||||
|
|
@ -279,6 +284,7 @@ import { ReadingDirection } from '@/types/enum-books'
|
||||||
const cookieFit = 'webreader.fit'
|
const cookieFit = 'webreader.fit'
|
||||||
const cookieReadingDirection = 'webreader.readingDirection'
|
const cookieReadingDirection = 'webreader.readingDirection'
|
||||||
const cookieDoublePages = 'webreader.doublePages'
|
const cookieDoublePages = 'webreader.doublePages'
|
||||||
|
const cookieSwipe = 'webreader.swipe'
|
||||||
const cookieAnimations = 'webreader.animations'
|
const cookieAnimations = 'webreader.animations'
|
||||||
const cookieBackground = 'webreader.background'
|
const cookieBackground = 'webreader.background'
|
||||||
|
|
||||||
|
|
@ -313,6 +319,7 @@ export default Vue.extend({
|
||||||
goToPage: 1,
|
goToPage: 1,
|
||||||
settings: {
|
settings: {
|
||||||
doublePages: false,
|
doublePages: false,
|
||||||
|
swipe: true,
|
||||||
imageFits: Object.values(ImageFit),
|
imageFits: Object.values(ImageFit),
|
||||||
fit: ImageFit.HEIGHT,
|
fit: ImageFit.HEIGHT,
|
||||||
readingDirection: ReadingDirection.LEFT_TO_RIGHT,
|
readingDirection: ReadingDirection.LEFT_TO_RIGHT,
|
||||||
|
|
@ -354,6 +361,9 @@ export default Vue.extend({
|
||||||
this.loadFromCookie(cookieDoublePages, (v) => {
|
this.loadFromCookie(cookieDoublePages, (v) => {
|
||||||
this.doublePages = (v === 'true')
|
this.doublePages = (v === 'true')
|
||||||
})
|
})
|
||||||
|
this.loadFromCookie(cookieSwipe, (v) => {
|
||||||
|
this.swipe = (v === 'true')
|
||||||
|
})
|
||||||
this.loadFromCookie(cookieFit, (v) => {
|
this.loadFromCookie(cookieFit, (v) => {
|
||||||
if (v) {
|
if (v) {
|
||||||
this.imageFit = v
|
this.imageFit = v
|
||||||
|
|
@ -490,6 +500,15 @@ export default Vue.extend({
|
||||||
this.$cookies.set(cookieDoublePages, doublePages, Infinity)
|
this.$cookies.set(cookieDoublePages, doublePages, Infinity)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
swipe: {
|
||||||
|
get: function (): boolean {
|
||||||
|
return this.settings.swipe
|
||||||
|
},
|
||||||
|
set: function (swipe: boolean): void {
|
||||||
|
this.settings.swipe = swipe
|
||||||
|
this.$cookies.set(cookieSwipe, swipe, Infinity)
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
keyPressed (e: KeyboardEvent) {
|
keyPressed (e: KeyboardEvent) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue