feat(web reader): double page support

closes #61
This commit is contained in:
Gauthier Roebroeck 2020-01-09 17:19:42 +08:00
parent 00f7e71f4c
commit 77c9004d57

View file

@ -164,6 +164,21 @@
</v-col> </v-col>
</v-row> </v-row>
<!-- Menu: double pages buttons -->
<v-row justify="center">
<v-col cols="auto">
<v-btn-toggle v-model="doublePagesButtons" dense mandatory active-class="primary">
<v-btn @click="setDoublePages(false)">
Single page
</v-btn>
<v-btn @click="setDoublePages(true)">
Double pages
</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">
@ -226,6 +241,8 @@ export default Vue.extend({
fitHeight: true, fitHeight: true,
rtlButtons: 0, rtlButtons: 0,
rtl: false, rtl: false,
doublePages: false,
doublePagesButtons: 0,
slickOptions: { slickOptions: {
infinite: false, infinite: false,
arrows: false, arrows: false,
@ -236,7 +253,9 @@ export default Vue.extend({
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 rtl: false,
slidesToShow: 1,
slidesToScroll: 1
} }
} }
}, },
@ -373,6 +392,11 @@ export default Vue.extend({
this.rtl = rtl this.rtl = rtl
this.slickOptions.rtl = rtl; this.slickOptions.rtl = rtl;
(this.$refs.slick as any).setOption('rtl', rtl, true) (this.$refs.slick as any).setOption('rtl', rtl, true)
},
setDoublePages (doublePages: boolean) {
this.doublePages = doublePages
this.slickOptions.slidesToShow = doublePages ? 2 : 1;
(this.$refs.slick as any).setOption('slidesToShow', doublePages ? 2 : 1, true)
} }
} }
}) })