1
0
Fork 0
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:
Dmitry Lyzo 2020-05-02 14:02:44 +03:00
parent d98645135b
commit a3bc8c183e
7 changed files with 62 additions and 42 deletions

View file

@ -571,9 +571,9 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
row.querySelector(".btnSessionStop").classList.add("hide");
}
let icons = ["play_arrow", "pause"];
if (session.PlayState && session.PlayState.IsPaused) icons = icons.reverse();
btnSessionPlayPause.querySelector(".material-icons").classList.replace(icons[0], icons[1]);
const btnSessionPlayPauseIcon = btnSessionPlayPause.querySelector(".material-icons");
btnSessionPlayPauseIcon.classList.remove("play_arrow", "pause");
btnSessionPlayPauseIcon.classList.add(session.PlayState && session.PlayState.IsPaused ? "play_arrow" : "pause");
row.querySelector(".sessionNowPlayingStreamInfo").innerHTML = DashboardPage.getSessionNowPlayingStreamInfo(session);
row.querySelector(".sessionNowPlayingTime").innerHTML = DashboardPage.getSessionNowPlayingTime(session);