mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix code smell: 'for loop should be for-of'
This commit is contained in:
parent
5977a33686
commit
2b9141f4cd
2 changed files with 11 additions and 14 deletions
|
@ -679,9 +679,8 @@ function getCardTextLines(lines, cssClass, forceLines, isOuterFooter, cardLayout
|
|||
|
||||
let valid = 0;
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
for (const text of lines) {
|
||||
let currentCssClass = cssClass;
|
||||
const text = lines[i];
|
||||
|
||||
if (valid > 0 && isOuterFooter) {
|
||||
currentCssClass += ' cardText-secondary';
|
||||
|
@ -862,8 +861,8 @@ function getCardFooterText(item, apiClient, options, footerClass, progressHtml,
|
|||
|
||||
if (options.textLines) {
|
||||
const additionalLines = options.textLines(item);
|
||||
for (let i = 0; i < additionalLines.length; i++) {
|
||||
lines.push(additionalLines[i]);
|
||||
for (const additionalLine of additionalLines) {
|
||||
lines.push(additionalLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1724,8 +1723,7 @@ export function onTimerCreated(programId, newTimerId, itemsContainer) {
|
|||
export function onTimerCancelled(timerId, itemsContainer) {
|
||||
const cells = itemsContainer.querySelectorAll('.card[data-timerid="' + timerId + '"]');
|
||||
|
||||
for (let i = 0; i < cells.length; i++) {
|
||||
const cell = cells[i];
|
||||
for (const cell of cells) {
|
||||
const icon = cell.querySelector('.timerIndicator');
|
||||
if (icon) {
|
||||
icon.parentNode.removeChild(icon);
|
||||
|
@ -1742,8 +1740,7 @@ export function onTimerCancelled(timerId, itemsContainer) {
|
|||
export function onSeriesTimerCancelled(cancelledTimerId, itemsContainer) {
|
||||
const cells = itemsContainer.querySelectorAll('.card[data-seriestimerid="' + cancelledTimerId + '"]');
|
||||
|
||||
for (let i = 0; i < cells.length; i++) {
|
||||
const cell = cells[i];
|
||||
for (const cell of cells) {
|
||||
const icon = cell.querySelector('.timerIndicator');
|
||||
if (icon) {
|
||||
icon.parentNode.removeChild(icon);
|
||||
|
|
|
@ -100,10 +100,10 @@ export function loadSections(elem, apiClient, user, userSettings) {
|
|||
|
||||
export function destroySections(elem) {
|
||||
const elems = elem.querySelectorAll('.itemsContainer');
|
||||
for (let i = 0; i < elems.length; i++) {
|
||||
elems[i].fetchData = null;
|
||||
elems[i].parentContainer = null;
|
||||
elems[i].getItemsHtml = null;
|
||||
for (const e of elems) {
|
||||
e.fetchData = null;
|
||||
e.parentContainer = null;
|
||||
e.getItemsHtml = null;
|
||||
}
|
||||
|
||||
elem.innerHTML = '';
|
||||
|
@ -111,8 +111,8 @@ export function destroySections(elem) {
|
|||
|
||||
export function pause(elem) {
|
||||
const elems = elem.querySelectorAll('.itemsContainer');
|
||||
for (let i = 0; i < elems.length; i++) {
|
||||
elems[i].pause();
|
||||
for (const e of elems) {
|
||||
e.pause();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue