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
|
@ -616,12 +616,14 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
var info = playbackManager.getPlayerInfo();
|
||||
var icon = headerCastButton.querySelector(".material-icons");
|
||||
|
||||
icon.classList.remove("cast_connected", "cast");
|
||||
|
||||
if (info && !info.isLocalPlayer) {
|
||||
icon.classList.replace("cast", "cast_connected");
|
||||
icon.classList.add("cast_connected");
|
||||
headerCastButton.classList.add("castButton-active");
|
||||
context.querySelector(".headerSelectedPlayer").innerHTML = info.deviceName || info.name;
|
||||
} else {
|
||||
icon.classList.replace("cast_connected", "cast");
|
||||
icon.classList.add("cast");
|
||||
headerCastButton.classList.remove("castButton-active");
|
||||
context.querySelector(".headerSelectedPlayer").innerHTML = "";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue