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

Fix sonarcloud warning

This commit is contained in:
MrTimscampi 2020-08-18 20:31:10 +02:00
parent 161e1aff2f
commit 61a7dba964

View file

@ -12,7 +12,7 @@ import 'scrollStyles';
const buttonClass = 'emby-tab-button'; const buttonClass = 'emby-tab-button';
const activeButtonClass = buttonClass + '-active'; const activeButtonClass = buttonClass + '-active';
function setActiveTabButton(tabs, newButton) { function setActiveTabButton(newButton) {
newButton.classList.add(activeButtonClass); newButton.classList.add(activeButtonClass);
} }
@ -77,7 +77,7 @@ import 'scrollStyles';
const previousIndex = current ? parseInt(current.getAttribute('data-index')) : null; const previousIndex = current ? parseInt(current.getAttribute('data-index')) : null;
setActiveTabButton(tabs, tabButton); setActiveTabButton(tabButton);
const index = parseInt(tabButton.getAttribute('data-index')); const index = parseInt(tabButton.getAttribute('data-index'));
@ -192,7 +192,7 @@ import 'scrollStyles';
const newTabButton = tabButtons[currentIndex]; const newTabButton = tabButtons[currentIndex];
if (newTabButton) { if (newTabButton) {
setActiveTabButton(this, newTabButton, current, false); setActiveTabButton(newTabButton);
} }
} }
@ -240,7 +240,7 @@ import 'scrollStyles';
})); }));
const currentTabButton = tabButtons[current]; const currentTabButton = tabButtons[current];
setActiveTabButton(tabs, tabButtons[selected], currentTabButton, false); setActiveTabButton(tabButtons[selected]);
if (current !== selected && currentTabButton) { if (current !== selected && currentTabButton) {
currentTabButton.classList.remove(activeButtonClass); currentTabButton.classList.remove(activeButtonClass);