diff --git a/src/components/playback/brightnessosd.js b/src/components/playback/brightnessosd.js index 47551e8de..e73fc3968 100644 --- a/src/components/playback/brightnessosd.js +++ b/src/components/playback/brightnessosd.js @@ -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) { diff --git a/src/components/recordingcreator/recordingbutton.js b/src/components/recordingcreator/recordingbutton.js index a32803e10..e9c174bfd 100644 --- a/src/components/recordingcreator/recordingbutton.js +++ b/src/components/recordingcreator/recordingbutton.js @@ -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'); diff --git a/src/controllers/list.js b/src/controllers/list.js index 6e25242a0..bcc38f27c 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -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"); } } }