fix several issues with book navigation

This commit is contained in:
dkanada
2026-07-17 23:23:59 +09:00
parent 9d936b2085
commit 6aa203a91d
3 changed files with 12 additions and 6 deletions
+1 -2
View File
@@ -193,8 +193,7 @@ export class BookPlayer {
this.rendition?.on('keydown', this.onWindowKeyDown);
if (browser.safari) {
const player = document.querySelector('.bookOsd');
this.addSwipeGestures(player);
this.addSwipeGestures(document.querySelector('#bookPlayerContainer'));
} else {
this.rendition?.on('rendered', (e, i) => this.addSwipeGestures(i.document.documentElement));
}
+3 -3
View File
@@ -142,13 +142,13 @@ export class PdfPlayer {
bindEvents() {
this.mediaElement?.addEventListener('close', this.onDialogClosed, { once: true });
document.addEventListener('keydown', this.onWindowKeyDown);
document.addEventListener('touchstart', this.onTouchStart);
document.querySelector('#container')?.addEventListener('touchstart', this.onTouchStart);
}
unbindEvents() {
this.mediaElement?.removeEventListener('close', this.onDialogClosed);
document.removeEventListener('keydown', this.onWindowKeyDown);
document.removeEventListener('touchstart', this.onTouchStart);
document.querySelector('#container')?.removeEventListener('touchstart', this.onTouchStart);
}
createMediaElement(options) {
@@ -169,7 +169,7 @@ export class PdfPlayer {
});
elem.id = 'pdfPlayer';
elem.innerHTML = '<div id="bookOsdMount"></div><canvas id="canvas"></canvas>';
elem.innerHTML = '<div id="bookOsdMount"></div><div id="container"><canvas id="canvas"></canvas></div>';
dialogHelper.open(elem);
}
+8 -1
View File
@@ -1,3 +1,11 @@
#container {
position: relative;
display: grid;
place-items: center;
top: 5vh;
height: 90vh;
}
#pdfPlayer {
position: relative;
height: 100%;
@@ -8,7 +16,6 @@
#canvas {
position: relative;
top: 5vh;
display: block;
margin: auto;
}