mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use remove+add pattern for icons
This commit is contained in:
parent
d98645135b
commit
a3bc8c183e
7 changed files with 62 additions and 42 deletions
|
@ -280,11 +280,10 @@ define(['require', 'datetime', 'itemHelper', 'events', 'browser', 'imageLoader',
|
|||
|
||||
function updatePlayPauseState(isPaused) {
|
||||
if (playPauseButtons) {
|
||||
let icons = ['play_arrow', 'pause'];
|
||||
if (isPaused) icons = icons.reverse();
|
||||
|
||||
playPauseButtons.forEach((button) => {
|
||||
button.querySelector('.material-icons').classList.replace(icons[0], icons[1]);
|
||||
const icon = button.querySelector('.material-icons');
|
||||
icon.classList.remove('play_arrow', 'pause');
|
||||
icon.classList.add(isPaused ? 'play_arrow' : 'pause');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -387,9 +386,9 @@ define(['require', 'datetime', 'itemHelper', 'events', 'browser', 'imageLoader',
|
|||
showMuteButton = false;
|
||||
}
|
||||
|
||||
let icons = ['volume_off', 'volume_up'];
|
||||
if (isMuted) icons = icons.reverse();
|
||||
muteButton.querySelector('.material-icons').classList.replace(icons[0], icons[1]);
|
||||
const muteButtonIcon = muteButton.querySelector('.material-icons');
|
||||
muteButtonIcon.classList.remove('volume_off', 'volume_up');
|
||||
muteButtonIcon.classList.add(isMuted ? 'volume_off' : 'volume_up');
|
||||
|
||||
if (supportedCommands.indexOf('SetVolume') === -1) {
|
||||
showVolumeSlider = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue