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
|
@ -101,9 +101,8 @@ define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'materia
|
|||
function updatePlayerVolumeState(isMuted, volume) {
|
||||
|
||||
if (iconElement) {
|
||||
let icons = ["volume_off", "volume_up"];
|
||||
if (isMuted) icons = icons.reverse();
|
||||
iconElement.classList.replace(icons[0], icons[1]);
|
||||
iconElement.classList.remove('volume_off', 'volume_up');
|
||||
iconElement.classList.add(isMuted ? 'volume_off' : 'volume_up');
|
||||
}
|
||||
if (progressElement) {
|
||||
progressElement.style.width = (volume || 0) + '%';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue