Fix epub reader

This commit is contained in:
advplyr 2023-03-06 13:09:09 -06:00
parent f594b734c0
commit cb5d32bbb9
3 changed files with 7 additions and 16 deletions

View file

@ -58,13 +58,6 @@ export default {
this.rendition.next()
}
},
keyUp() {
if ((e.keyCode || e.which) == 37) {
this.prev()
} else if ((e.keyCode || e.which) == 39) {
this.next()
}
},
initEpub() {
var book = ePub(this.url)
this.book = book
@ -93,7 +86,7 @@ export default {
console.error('No Start', currentLocation)
} else {
var currentPage = book.locations.percentageFromCfi(currentLocation.start.cfi)
// console.log('current page', currentPage)
console.log('current page', currentPage)
}
})
})
@ -105,10 +98,10 @@ export default {
})
this.chapters = _chapters
})
book.loaded.metadata.then((metadata) => {
// this.author = metadata.creator
// this.title = metadata.title
})
// book.loaded.metadata.then((metadata) => {
// this.author = metadata.creator
// this.title = metadata.title
// })
// const spine_get = book.spine.get.bind(book.spine)
// book.spine.get = function (target) {
@ -121,8 +114,6 @@ export default {
// return t
// }
this.rendition.on('keyup', this.keyUp)
this.rendition.on('relocated', (location) => {
var percent = book.locations.percentageFromCfi(location.start.cfi)
this.progress = Math.floor(percent * 100)