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

Fix sonarjs no-collapsible-if

This commit is contained in:
Bill Thornton 2022-10-03 14:22:02 -04:00
parent ccdbf0bfc3
commit 1f4e65822b
33 changed files with 330 additions and 473 deletions

View file

@ -85,13 +85,9 @@ import 'webcomponents.js/webcomponents-lite';
passive: true
});
if (browser.orsay) {
if (this === document.activeElement) {
//Make sure the IME pops up if this is the first/default element on the page
if (document.attachIME) {
document.attachIME(this);
}
}
//Make sure the IME pops up if this is the first/default element on the page
if (browser.orsay && this === document.activeElement && document.attachIME) {
document.attachIME(this);
}
};

View file

@ -21,10 +21,8 @@ import Sortable from 'sortablejs';
const itemsContainer = this;
const multiSelect = itemsContainer.multiSelect;
if (multiSelect) {
if (multiSelect.onContainerClick.call(itemsContainer, e) === false) {
return;
}
if (multiSelect?.onContainerClick.call(itemsContainer, e) === false) {
return;
}
itemShortcuts.onClick.call(itemsContainer, e);
@ -259,11 +257,9 @@ import Sortable from 'sortablejs';
itemsContainer.notifyRefreshNeeded(true);
return;
}
} else if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Audio') {
if (eventsToMonitor.indexOf('audioplayback') !== -1) {
itemsContainer.notifyRefreshNeeded(true);
return;
}
} else if (state.NowPlayingItem?.MediaType === 'Audio' && eventsToMonitor.indexOf('audioplayback') !== -1) {
itemsContainer.notifyRefreshNeeded(true);
return;
}
}
@ -298,10 +294,8 @@ import Sortable from 'sortablejs';
}
}
if (layoutManager.desktop || layoutManager.mobile) {
if (this.getAttribute('data-multiselect') !== 'false') {
this.enableMultiSelect(true);
}
if (layoutManager.desktop || layoutManager.mobile && this.getAttribute('data-multiselect') !== 'false') {
this.enableMultiSelect(true);
}
if (layoutManager.tv) {

View file

@ -443,10 +443,8 @@ import '../emby-input/emby-input';
}
for (const range of ranges) {
if (position != null) {
if (position >= range.end) {
continue;
}
if (position != null && position >= range.end) {
continue;
}
setRange(elem, range.start, range.end);

View file

@ -272,10 +272,8 @@ import '../../assets/css/scrollstyles.scss';
let sibling = elem[method];
while (sibling) {
if (sibling.classList.contains(buttonClass)) {
if (!sibling.classList.contains('hide')) {
return sibling;
}
if (sibling.classList.contains(buttonClass) && !sibling.classList.contains('hide')) {
return sibling;
}
sibling = sibling[method];