mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Create function to reduce code reuse
This commit is contained in:
parent
789eed49af
commit
02671c7fd3
2 changed files with 272 additions and 12 deletions
|
@ -186,21 +186,15 @@ define(['require', 'datetime', 'itemHelper', 'events', 'browser', 'imageLoader',
|
|||
volumeSliderContainer.classList.remove('hide');
|
||||
}
|
||||
|
||||
volumeSlider.addEventListener('change', function () {
|
||||
function setVolume() {
|
||||
if (currentPlayer) {
|
||||
currentPlayer.setVolume(this.value);
|
||||
}
|
||||
});
|
||||
volumeSlider.addEventListener('mousemove', function () {
|
||||
if (currentPlayer) {
|
||||
currentPlayer.setVolume(this.value);
|
||||
}
|
||||
});
|
||||
volumeSlider.addEventListener('touchmove', function () {
|
||||
if (currentPlayer) {
|
||||
currentPlayer.setVolume(this.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
volumeSlider.addEventListener('change', setVolume.bind(this));
|
||||
volumeSlider.addEventListener('mousemove', setVolume.bind(this));
|
||||
volumeSlider.addEventListener('touchmove', setVolume.bind(this));
|
||||
|
||||
|
||||
positionSlider = elem.querySelector('.nowPlayingBarPositionSlider');
|
||||
positionSlider.addEventListener('change', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue