mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add volume adjust onwheel scroll event
This commit is contained in:
parent
1019a43216
commit
b97d6d3441
1 changed files with 11 additions and 0 deletions
|
@ -1287,6 +1287,15 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
||||||
resetIdle();
|
resetIdle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onWheel(e) {
|
||||||
|
if (e.deltaY < 0) {
|
||||||
|
playbackManager.volumeUp(currentPlayer);
|
||||||
|
}
|
||||||
|
if (e.deltaY > 0) {
|
||||||
|
playbackManager.volumeDown(currentPlayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onWindowMouseDown(e) {
|
function onWindowMouseDown(e) {
|
||||||
clickedElement = e.target;
|
clickedElement = e.target;
|
||||||
mouseIsDown = true;
|
mouseIsDown = true;
|
||||||
|
@ -1445,6 +1454,7 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
document.addEventListener('wheel', onWheel);
|
||||||
/* eslint-disable-next-line compat/compat */
|
/* eslint-disable-next-line compat/compat */
|
||||||
dom.addEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
|
dom.addEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
|
||||||
capture: true,
|
capture: true,
|
||||||
|
@ -1486,6 +1496,7 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
document.removeEventListener('wheel', onWheel);
|
||||||
/* eslint-disable-next-line compat/compat */
|
/* eslint-disable-next-line compat/compat */
|
||||||
dom.removeEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
|
dom.removeEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
|
||||||
capture: true,
|
capture: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue