mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add some linting rules for the CI (#587)
* enable one-var rule * enable indent rule * enable no-multiple-empty-lines rule * enable no-empty rule * enable no-trailing-spaces rule * enable no-extra-semi rule * add eslint rules to fix block spacing * enable max-statements-per-line rule * enable brace-style rule * fix some spacing issues and add future rules * add code suggestions
This commit is contained in:
parent
0b0ea7f406
commit
3739741786
101 changed files with 883 additions and 1051 deletions
|
@ -82,7 +82,7 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'ResizeObserver', 'sc
|
|||
intervactive: null, // Selector for special interactive elements.
|
||||
|
||||
// Mixed options
|
||||
speed: 0, // Animations speed in milliseconds. 0 to disable animations.
|
||||
speed: 0 // Animations speed in milliseconds. 0 to disable animations.
|
||||
|
||||
}, options);
|
||||
|
||||
|
@ -93,17 +93,14 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'ResizeObserver', 'sc
|
|||
// in cases with firefox, if the smooth scroll api is supported then use that because their implementation is very good
|
||||
if (options.allowNativeScroll === false) {
|
||||
options.enableNativeScroll = false;
|
||||
}
|
||||
else if (isSmoothScrollSupported && ((browser.firefox && !layoutManager.tv) || options.allowNativeSmoothScroll)) {
|
||||
} else if (isSmoothScrollSupported && ((browser.firefox && !layoutManager.tv) || options.allowNativeSmoothScroll)) {
|
||||
// native smooth scroll
|
||||
options.enableNativeScroll = true;
|
||||
}
|
||||
else if (options.requireAnimation && (browser.animate || browser.supportsCssAnimation())) {
|
||||
} else if (options.requireAnimation && (browser.animate || browser.supportsCssAnimation())) {
|
||||
|
||||
// transform is the only way to guarantee animation
|
||||
options.enableNativeScroll = false;
|
||||
}
|
||||
else if (!layoutManager.tv || !browser.animate) {
|
||||
} else if (!layoutManager.tv || !browser.animate) {
|
||||
|
||||
options.enableNativeScroll = true;
|
||||
}
|
||||
|
@ -211,7 +208,9 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'ResizeObserver', 'sc
|
|||
self.frameResizeObserver.observe(frame);
|
||||
}
|
||||
|
||||
self.reload = function () { load(); };
|
||||
self.reload = function () {
|
||||
load();
|
||||
};
|
||||
|
||||
self.getScrollEventName = function () {
|
||||
return transform ? 'scrollanimate' : 'scroll';
|
||||
|
@ -227,7 +226,6 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'ResizeObserver', 'sc
|
|||
|
||||
function nativeScrollTo(container, pos, immediate) {
|
||||
|
||||
|
||||
if (container.scroll) {
|
||||
if (o.horizontal) {
|
||||
|
||||
|
@ -242,8 +240,7 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'ResizeObserver', 'sc
|
|||
behavior: immediate ? 'instant' : 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (!immediate && container.scrollTo) {
|
||||
} else if (!immediate && container.scrollTo) {
|
||||
if (o.horizontal) {
|
||||
container.scrollTo(Math.round(pos), 0);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue