mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #898 from dmitrylyzo/fix_recording_icon
Fix icon doubling
This commit is contained in:
commit
2a99df8365
3 changed files with 29 additions and 7 deletions
|
@ -98,15 +98,22 @@ define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'materia
|
|||
}
|
||||
}
|
||||
|
||||
function setIcon(iconElement, icon) {
|
||||
iconElement.classList.remove('brightness_high');
|
||||
iconElement.classList.remove('brightness_medium');
|
||||
iconElement.classList.remove('brightness_low');
|
||||
iconElement.classList.add(icon);
|
||||
}
|
||||
|
||||
function updateElementsFromPlayer(brightness) {
|
||||
|
||||
if (iconElement) {
|
||||
if (brightness >= 80) {
|
||||
iconElement.innerHTML = '';
|
||||
setIcon(iconElement, 'brightness_high');
|
||||
} else if (brightness >= 20) {
|
||||
iconElement.innerHTML = '';
|
||||
setIcon(iconElement, 'brightness_medium');
|
||||
} else {
|
||||
iconElement.innerHTML = '';
|
||||
setIcon(iconElement, 'brightness_low');
|
||||
}
|
||||
}
|
||||
if (progressElement) {
|
||||
|
|
|
@ -21,16 +21,25 @@ define(['globalize', 'connectionManager', 'require', 'loading', 'apphost', 'dom'
|
|||
}
|
||||
}
|
||||
|
||||
function setButtonIcon(button, icon) {
|
||||
var inner = button.querySelector('i');
|
||||
inner.classList.remove('fiber_smart_record');
|
||||
inner.classList.remove('fiber_manual_record');
|
||||
inner.classList.add(icon);
|
||||
}
|
||||
|
||||
function RecordingButton(options) {
|
||||
this.options = options;
|
||||
|
||||
var button = options.button;
|
||||
|
||||
setButtonIcon(button, 'fiber_manual_record');
|
||||
|
||||
if (options.item) {
|
||||
this.refreshItem(options.item);
|
||||
} else if (options.itemId && options.serverId) {
|
||||
this.refresh(options.itemId, options.serverId);
|
||||
}
|
||||
var button = options.button;
|
||||
button.querySelector('i').innerHTML = 'fiber_manual_record';
|
||||
|
||||
var clickFn = onRecordingButtonClick.bind(this);
|
||||
this.clickFn = clickFn;
|
||||
|
@ -80,7 +89,7 @@ define(['globalize', 'connectionManager', 'require', 'loading', 'apphost', 'dom'
|
|||
var options = this.options;
|
||||
var button = options.button;
|
||||
this.item = item;
|
||||
button.querySelector('i').innerHTML = getIndicatorIcon(item);
|
||||
setButtonIcon(button, getIndicatorIcon(item));
|
||||
|
||||
if (item.TimerId && (item.Status || 'Cancelled') !== 'Cancelled') {
|
||||
button.classList.add('recordingIcon-active');
|
||||
|
|
|
@ -157,6 +157,12 @@ define(["globalize", "listView", "layoutManager", "userSettings", "focusManager"
|
|||
return query;
|
||||
}
|
||||
|
||||
function setSortButtonIcon(btnSortIcon, icon) {
|
||||
btnSortIcon.classList.remove("arrow_downward");
|
||||
btnSortIcon.classList.remove("arrow_upward");
|
||||
btnSortIcon.classList.add(icon);
|
||||
}
|
||||
|
||||
function updateSortText(instance) {
|
||||
var btnSortText = instance.btnSortText;
|
||||
|
||||
|
@ -175,7 +181,7 @@ define(["globalize", "listView", "layoutManager", "userSettings", "focusManager"
|
|||
var btnSortIcon = instance.btnSortIcon;
|
||||
|
||||
if (btnSortIcon) {
|
||||
btnSortIcon.innerHTML = "Descending" === values.sortOrder ? "" : "";
|
||||
setSortButtonIcon(btnSortIcon, "Descending" === values.sortOrder ? "arrow_downward" : "arrow_upward");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue