mirror of
https://github.com/gotson/komga.git
synced 2026-05-07 12:01:40 +02:00
parent
4085f1fdaa
commit
98efa9b448
1 changed files with 38 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="pages.length > 0" style="background: black; width: 100%; height: 100%">
|
<div v-if="pages.length > 0" style="background: black; width: 100%; height: 100%">
|
||||||
<!-- clickable zone: previous page -->
|
<!-- clickable zone: left -->
|
||||||
<div @click="prev"
|
<div @click="rtl ? next() : prev()"
|
||||||
class="left-quarter full-height"
|
class="left-quarter full-height"
|
||||||
style="z-index: 1; position: absolute"
|
style="z-index: 1; position: absolute"
|
||||||
/>
|
/>
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
style="z-index: 1; position: absolute"
|
style="z-index: 1; position: absolute"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- clickable zone: next page -->
|
<!-- clickable zone: right -->
|
||||||
<div @click="next"
|
<div @click="rtl ? prev() : next()"
|
||||||
class="right-quarter full-height"
|
class="right-quarter full-height"
|
||||||
style="z-index: 1; position: absolute"
|
style="z-index: 1; position: absolute"
|
||||||
/>
|
/>
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
<slick ref="slick"
|
<slick ref="slick"
|
||||||
:options="slickOptions"
|
:options="slickOptions"
|
||||||
@afterChange="slickAfterChange"
|
@afterChange="slickAfterChange"
|
||||||
|
:dir="rtl ? 'rtl' : 'ltr'"
|
||||||
>
|
>
|
||||||
<!-- Carousel: pages -->
|
<!-- Carousel: pages -->
|
||||||
<v-img v-for="p in pages"
|
<v-img v-for="p in pages"
|
||||||
|
|
@ -136,18 +137,33 @@
|
||||||
<!-- Menu: fit buttons -->
|
<!-- Menu: fit buttons -->
|
||||||
<v-row justify="center">
|
<v-row justify="center">
|
||||||
<v-col cols="auto">
|
<v-col cols="auto">
|
||||||
<v-btn-toggle v-model="fitButtons" dense mandatory>
|
<v-btn-toggle v-model="fitButtons" dense mandatory active-class="primary">
|
||||||
<v-btn @click="fitHeight = false" color="primary">
|
<v-btn @click="fitHeight = false">
|
||||||
Fit to width
|
Fit to width
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<v-btn @click="fitHeight = true" color="primary">
|
<v-btn @click="fitHeight = true">
|
||||||
Fit to height
|
Fit to height
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-btn-toggle>
|
</v-btn-toggle>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
<!-- Menu: RTL buttons -->
|
||||||
|
<v-row justify="center">
|
||||||
|
<v-col cols="auto">
|
||||||
|
<v-btn-toggle v-model="rtlButtons" dense mandatory active-class="primary">
|
||||||
|
<v-btn @click="setRtl(false)">
|
||||||
|
Left to right
|
||||||
|
</v-btn>
|
||||||
|
|
||||||
|
<v-btn @click="setRtl(true)">
|
||||||
|
Right to left
|
||||||
|
</v-btn>
|
||||||
|
</v-btn-toggle>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
<!-- Menu: keyboard shortcuts -->
|
<!-- Menu: keyboard shortcuts -->
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="auto">
|
<v-col cols="auto">
|
||||||
|
|
@ -160,8 +176,10 @@
|
||||||
<div><kbd>esc</kbd></div>
|
<div><kbd>esc</kbd></div>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<div>Previous page</div>
|
<div v-if="!rtl">Previous page</div>
|
||||||
<div>Next page</div>
|
<div v-else>Next page</div>
|
||||||
|
<div v-if="!rtl">Next page</div>
|
||||||
|
<div v-else>Previous page</div>
|
||||||
<div>First page</div>
|
<div>First page</div>
|
||||||
<div>Last page</div>
|
<div>Last page</div>
|
||||||
<div>Scroll down</div>
|
<div>Scroll down</div>
|
||||||
|
|
@ -205,6 +223,8 @@ export default Vue.extend({
|
||||||
showMenu: false,
|
showMenu: false,
|
||||||
fitButtons: 1,
|
fitButtons: 1,
|
||||||
fitHeight: true,
|
fitHeight: true,
|
||||||
|
rtlButtons: 0,
|
||||||
|
rtl: false,
|
||||||
slickOptions: {
|
slickOptions: {
|
||||||
infinite: false,
|
infinite: false,
|
||||||
arrows: false,
|
arrows: false,
|
||||||
|
|
@ -214,7 +234,8 @@ export default Vue.extend({
|
||||||
touchMove: false,
|
touchMove: false,
|
||||||
cssEase: 'cubic-bezier(0.250, 0.100, 0.250, 1.000)',
|
cssEase: 'cubic-bezier(0.250, 0.100, 0.250, 1.000)',
|
||||||
speed: 150,
|
speed: 150,
|
||||||
initialSlide: 0
|
initialSlide: 0,
|
||||||
|
rtl: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -262,11 +283,11 @@ export default Vue.extend({
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case 'PageUp':
|
case 'PageUp':
|
||||||
case 'ArrowRight':
|
case 'ArrowRight':
|
||||||
this.next()
|
this.rtl ? this.prev() : this.next()
|
||||||
break
|
break
|
||||||
case 'PageDown':
|
case 'PageDown':
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
this.prev()
|
this.rtl ? this.next() : this.prev()
|
||||||
break
|
break
|
||||||
case 'Home':
|
case 'Home':
|
||||||
this.goToFirst()
|
this.goToFirst()
|
||||||
|
|
@ -339,6 +360,11 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
slickAfterChange (event: any, slick: any, currentSlide: any) {
|
slickAfterChange (event: any, slick: any, currentSlide: any) {
|
||||||
this.currentPage = currentSlide + 1
|
this.currentPage = currentSlide + 1
|
||||||
|
},
|
||||||
|
setRtl (rtl: boolean) {
|
||||||
|
this.rtl = rtl
|
||||||
|
this.slickOptions.rtl = rtl;
|
||||||
|
(this.$refs.slick as any).setOption('rtl', rtl, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue