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

lint and replace for with for...of

This commit is contained in:
Cameron 2020-08-04 09:03:02 +01:00
parent 947f8ba05d
commit 44800858e5
2 changed files with 10 additions and 5 deletions

View file

@ -24,4 +24,4 @@ export default function (view, params, tabContent) {
guideInstance.pause(); guideInstance.pause();
} }
}; };
}; }

View file

@ -12,16 +12,17 @@ function getBackdropShape() {
function getTimersHtml(timers, options) { function getTimersHtml(timers, options) {
options = options || {}; options = options || {};
const items = timers.map(function (t) { const items = timers.map(function (t) {
t.Type = 'Timer'; t.Type = 'Timer';
return t; return t;
}); });
const groups = []; const groups = [];
let currentGroupName = ''; let currentGroupName = '';
let currentGroup = []; let currentGroup = [];
for (let i = 0, length = items.length; i < length; i++) { for (const item in items) {
const item = items[i];
let dateText = ''; let dateText = '';
if (options.indexByDate !== false && item.StartDate) { if (options.indexByDate !== false && item.StartDate) {
@ -51,6 +52,7 @@ function getTimersHtml(timers, options) {
currentGroup.push(item); currentGroup.push(item);
} }
} }
if (currentGroup.length) { if (currentGroup.length) {
groups.push({ groups.push({
name: currentGroupName, name: currentGroupName,
@ -58,12 +60,12 @@ function getTimersHtml(timers, options) {
}); });
} }
let html = ''; let html = '';
for (let i = 0, length = groups.length; i < length; i++) { for (const group in groups) {
const group = groups[i];
if (group.name) { if (group.name) {
html += '<div class="verticalSection">'; html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + group.name + '</h2>'; html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + group.name + '</h2>';
} }
if (enableScrollX()) { if (enableScrollX()) {
let scrollXClass = 'scrollX hiddenScrollX'; let scrollXClass = 'scrollX hiddenScrollX';
if (layoutManager.tv) { if (layoutManager.tv) {
@ -73,6 +75,7 @@ function getTimersHtml(timers, options) {
} else { } else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap padded-left padded-right">'; html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap padded-left padded-right">';
} }
html += cardBuilder.getCardsHtml({ html += cardBuilder.getCardsHtml({
items: group.items, items: group.items,
shape: getBackdropShape(), shape: getBackdropShape(),
@ -91,7 +94,9 @@ function getTimersHtml(timers, options) {
overlayText: false, overlayText: false,
showChannelLogo: true showChannelLogo: true
}); });
html += '</div>'; html += '</div>';
if (group.name) { if (group.name) {
html += '</div>'; html += '</div>';
} }