1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix recording button icon

This commit is contained in:
Dmitry Lyzo 2020-03-07 13:15:30 +03:00
parent a76583de60
commit 7cb83755e6

View file

@ -21,6 +21,13 @@ 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) { function RecordingButton(options) {
this.options = options; this.options = options;
@ -30,7 +37,7 @@ define(['globalize', 'connectionManager', 'require', 'loading', 'apphost', 'dom'
this.refresh(options.itemId, options.serverId); this.refresh(options.itemId, options.serverId);
} }
var button = options.button; var button = options.button;
button.querySelector('i').innerHTML = 'fiber_manual_record'; setButtonIcon(button, 'fiber_manual_record');
var clickFn = onRecordingButtonClick.bind(this); var clickFn = onRecordingButtonClick.bind(this);
this.clickFn = clickFn; this.clickFn = clickFn;
@ -80,7 +87,7 @@ define(['globalize', 'connectionManager', 'require', 'loading', 'apphost', 'dom'
var options = this.options; var options = this.options;
var button = options.button; var button = options.button;
this.item = item; this.item = item;
button.querySelector('i').innerHTML = getIndicatorIcon(item); setButtonIcon(button, getIndicatorIcon(item));
if (item.TimerId && (item.Status || 'Cancelled') !== 'Cancelled') { if (item.TimerId && (item.Status || 'Cancelled') !== 'Cancelled') {
button.classList.add('recordingIcon-active'); button.classList.add('recordingIcon-active');