1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix toc button for new book player class

This commit is contained in:
dkanada 2020-05-22 10:55:34 +09:00
parent 512f33a7fb
commit f7f778b353

View file

@ -149,7 +149,7 @@ export class BookPlayer {
dialogHelper.open(tocElement);
}
});
}.bind(this));
dialogHelper.open(elem);
@ -169,20 +169,18 @@ export class BookPlayer {
return new Promise(function (resolve, reject) {
require(['epubjs'], function (epubjs) {
let downloadHref = apiClient.getItemDownloadUrl(options.items[0].Id);
self._currentSrc = downloadHref;
let book = epubjs.default(downloadHref, {openAs: 'epub'});
let rendition = book.renderTo(elem, {width: '100%', height: '97%'});
self._rendition = rendition;
self._currentSrc = downloadHref;
self._rendition = rendition;
return rendition.display().then(function () {
document.addEventListener('keyup', self.onWindowKeyUp.bind(self));
// FIXME: I don't really get why document keyup event is not triggered when epub is in focus
self._rendition.on('keyup', self.onWindowKeyUp.bind(self));
loading.hide();
return resolve();
}, function () {
console.error('Failed to display epub');