mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use keydown event to get actual modifiers
This commit is contained in:
parent
d20c617d30
commit
4c68f500d9
3 changed files with 14 additions and 14 deletions
|
@ -45,7 +45,7 @@ export class BookPlayer {
|
|||
this.decreaseFontSize = this.decreaseFontSize.bind(this);
|
||||
this.previous = this.previous.bind(this);
|
||||
this.next = this.next.bind(this);
|
||||
this.onWindowKeyUp = this.onWindowKeyUp.bind(this);
|
||||
this.onWindowKeyDown = this.onWindowKeyDown.bind(this);
|
||||
this.addSwipeGestures = this.addSwipeGestures.bind(this);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ export class BookPlayer {
|
|||
return true;
|
||||
}
|
||||
|
||||
onWindowKeyUp(e) {
|
||||
onWindowKeyDown(e) {
|
||||
const key = keyboardnavigation.getKeyName(e);
|
||||
|
||||
if (!this.loaded) return;
|
||||
|
@ -184,8 +184,8 @@ export class BookPlayer {
|
|||
bindEvents() {
|
||||
this.bindMediaElementEvents();
|
||||
|
||||
document.addEventListener('keyup', this.onWindowKeyUp);
|
||||
this.rendition?.on('keyup', this.onWindowKeyUp);
|
||||
document.addEventListener('keydown', this.onWindowKeyDown);
|
||||
this.rendition?.on('keydown', this.onWindowKeyDown);
|
||||
|
||||
if (browser.safari) {
|
||||
const player = document.getElementById('bookPlayerContainer');
|
||||
|
@ -214,8 +214,8 @@ export class BookPlayer {
|
|||
this.unbindMediaElementEvents();
|
||||
}
|
||||
|
||||
document.removeEventListener('keyup', this.onWindowKeyUp);
|
||||
this.rendition?.off('keyup', this.onWindowKeyUp);
|
||||
document.removeEventListener('keydown', this.onWindowKeyDown);
|
||||
this.rendition?.off('keydown', this.onWindowKeyDown);
|
||||
|
||||
if (!browser.safari) {
|
||||
this.rendition?.off('rendered', (e, i) => this.addSwipeGestures(i.document.documentElement));
|
||||
|
|
|
@ -23,7 +23,7 @@ export class ComicsPlayer {
|
|||
this.imageMap = new Map();
|
||||
|
||||
this.onDialogClosed = this.onDialogClosed.bind(this);
|
||||
this.onWindowKeyUp = this.onWindowKeyUp.bind(this);
|
||||
this.onWindowKeyDown = this.onWindowKeyDown.bind(this);
|
||||
}
|
||||
|
||||
play(options) {
|
||||
|
@ -177,7 +177,7 @@ export class ComicsPlayer {
|
|||
this.swiperInstance.update();
|
||||
}
|
||||
|
||||
onWindowKeyUp(e) {
|
||||
onWindowKeyDown(e) {
|
||||
const key = keyboardnavigation.getKeyName(e);
|
||||
if (key === 'Escape') {
|
||||
this.stop();
|
||||
|
@ -196,7 +196,7 @@ export class ComicsPlayer {
|
|||
bindEvents() {
|
||||
this.bindMediaElementEvents();
|
||||
|
||||
document.addEventListener('keyup', this.onWindowKeyUp);
|
||||
document.addEventListener('keydown', this.onWindowKeyDown);
|
||||
}
|
||||
|
||||
unbindMediaElementEvents() {
|
||||
|
@ -211,7 +211,7 @@ export class ComicsPlayer {
|
|||
unbindEvents() {
|
||||
this.unbindMediaElementEvents();
|
||||
|
||||
document.removeEventListener('keyup', this.onWindowKeyUp);
|
||||
document.removeEventListener('keydown', this.onWindowKeyDown);
|
||||
}
|
||||
|
||||
createMediaElement() {
|
||||
|
|
|
@ -18,7 +18,7 @@ export class PdfPlayer {
|
|||
this.priority = 1;
|
||||
|
||||
this.onDialogClosed = this.onDialogClosed.bind(this);
|
||||
this.onWindowKeyUp = this.onWindowKeyUp.bind(this);
|
||||
this.onWindowKeyDown = this.onWindowKeyDown.bind(this);
|
||||
this.onTouchStart = this.onTouchStart.bind(this);
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ export class PdfPlayer {
|
|||
return true;
|
||||
}
|
||||
|
||||
onWindowKeyUp(e) {
|
||||
onWindowKeyDown(e) {
|
||||
if (!this.loaded) return;
|
||||
|
||||
const key = keyboardnavigation.getKeyName(e);
|
||||
|
@ -133,7 +133,7 @@ export class PdfPlayer {
|
|||
bindEvents() {
|
||||
this.bindMediaElementEvents();
|
||||
|
||||
document.addEventListener('keyup', this.onWindowKeyUp);
|
||||
document.addEventListener('keydown', this.onWindowKeyDown);
|
||||
document.addEventListener('touchstart', this.onTouchStart);
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ export class PdfPlayer {
|
|||
this.unbindMediaElementEvents();
|
||||
}
|
||||
|
||||
document.removeEventListener('keyup', this.onWindowKeyUp);
|
||||
document.removeEventListener('keydown', this.onWindowKeyDown);
|
||||
document.removeEventListener('touchstart', this.onTouchStart);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue