Compare commits

...

2 Commits

Author SHA1 Message Date
Simon Bruder d02ae9dbb4
Store page width in localStorage
continuous-integration/drone/push Build is passing Details
2019-12-22 21:17:30 +00:00
Simon Bruder 772be9d1d1
Show page width 2019-12-22 21:17:17 +00:00
1 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@
<p>{{ page + 1 }}/{{ info.pages.length }}</p>
<p>
<button :disabled="originalPageWidth" v-on:click="changePageWidth(-5)">-</button>
<span>{{ pageWidth }}</span>
<button :disabled="originalPageWidth" v-on:click="changePageWidth(5)">+</button>
<br/>
<button v-on:click="originalPageWidth = !originalPageWidth">{{ originalPageWidth ? 'fixed width' : '1:1' }}</button>
@ -57,6 +58,10 @@ export default {
},
mounted () {
API.getVolumeInfo(this.$route.params.id, info => (this.info = info))
if (localStorage.pageWidth) {
this.pageWidth = parseInt(localStorage.pageWidth)
}
},
methods: {
setPage (page) {
@ -91,6 +96,7 @@ export default {
changePageWidth (change) {
if (this.pageWidth + change > 0 && this.pageWidth + change <= 100) {
this.pageWidth += change
localStorage.pageWidth = this.pageWidth
}
},