mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #4552 from rqres/fix-codesmell-for-of
Refactor `for` loops to `for-of` loops
This commit is contained in:
commit
01acfeb3ac
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1721,8 +1720,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);
|
||||
|
@ -1739,8 +1737,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue