mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #919 from dmitrylyzo/fix_icons-2
Fix icons doubling and WebOS support
This commit is contained in:
commit
c5171a2fa0
5 changed files with 18 additions and 11 deletions
|
@ -49,7 +49,7 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma
|
|||
html += "</a>";
|
||||
html += "</div>";
|
||||
if (task.State === "Running") {
|
||||
html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStopTask" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStop") + '"><i class="material-icons">stop</i></button>';
|
||||
html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStopTask" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStop") + '"><i class="material-icons stop"></i></button>';
|
||||
} else if (task.State === "Idle") {
|
||||
html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStartTask" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStart") + '"><i class="material-icons play_arrow"></i></button>';
|
||||
}
|
||||
|
@ -90,16 +90,22 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma
|
|||
return html;
|
||||
}
|
||||
|
||||
function setTaskButtonIcon(button, icon) {
|
||||
var inner = button.querySelector("i");
|
||||
inner.classList.remove("stop", "play_arrow");
|
||||
inner.classList.add(icon);
|
||||
}
|
||||
|
||||
function updateTaskButton(elem, state) {
|
||||
if (state === "Running") {
|
||||
elem.classList.remove("btnStartTask");
|
||||
elem.classList.add("btnStopTask");
|
||||
elem.querySelector("i").innerHTML = "stop";
|
||||
setTaskButtonIcon(elem, "stop");
|
||||
elem.title = globalize.translate("ButtonStop");
|
||||
} else if (state === "Idle") {
|
||||
elem.classList.add("btnStartTask");
|
||||
elem.classList.remove("btnStopTask");
|
||||
elem.querySelector("i").innerHTML = "";
|
||||
setTaskButtonIcon(elem, "play_arrow");
|
||||
elem.title = globalize.translate("ButtonStart");
|
||||
}
|
||||
$(elem).parents(".listItem")[0].setAttribute("data-status", state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue