fix toc button for new book player class
This commit is contained in:
parent
512f33a7fb
commit
f7f778b353
1 changed files with 4 additions and 6 deletions
|
@ -149,7 +149,7 @@ export class BookPlayer {
|
||||||
|
|
||||||
dialogHelper.open(tocElement);
|
dialogHelper.open(tocElement);
|
||||||
}
|
}
|
||||||
});
|
}.bind(this));
|
||||||
|
|
||||||
dialogHelper.open(elem);
|
dialogHelper.open(elem);
|
||||||
|
|
||||||
|
@ -169,20 +169,18 @@ export class BookPlayer {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
require(['epubjs'], function (epubjs) {
|
require(['epubjs'], function (epubjs) {
|
||||||
let downloadHref = apiClient.getItemDownloadUrl(options.items[0].Id);
|
let downloadHref = apiClient.getItemDownloadUrl(options.items[0].Id);
|
||||||
self._currentSrc = downloadHref;
|
|
||||||
|
|
||||||
let book = epubjs.default(downloadHref, {openAs: 'epub'});
|
let book = epubjs.default(downloadHref, {openAs: 'epub'});
|
||||||
|
|
||||||
let rendition = book.renderTo(elem, {width: '100%', height: '97%'});
|
let rendition = book.renderTo(elem, {width: '100%', height: '97%'});
|
||||||
self._rendition = rendition;
|
|
||||||
|
|
||||||
|
self._currentSrc = downloadHref;
|
||||||
|
self._rendition = rendition;
|
||||||
return rendition.display().then(function () {
|
return rendition.display().then(function () {
|
||||||
document.addEventListener('keyup', self.onWindowKeyUp.bind(self));
|
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
|
// 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));
|
self._rendition.on('keyup', self.onWindowKeyUp.bind(self));
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
return resolve();
|
return resolve();
|
||||||
}, function () {
|
}, function () {
|
||||||
console.error('Failed to display epub');
|
console.error('Failed to display epub');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue