[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const easingOutQuint = (
|
||||
x: number,
|
||||
_x: number,
|
||||
t: number,
|
||||
b: number,
|
||||
c: number,
|
||||
@@ -7,7 +7,7 @@ const easingOutQuint = (
|
||||
) => c * ((t = t / d - 1) * t * t * t * t + 1) + b;
|
||||
const scroll = (
|
||||
node: Element,
|
||||
key: 'scrollTop' | 'scrollLeft',
|
||||
key: "scrollTop" | "scrollLeft",
|
||||
target: number,
|
||||
) => {
|
||||
const startTime = Date.now();
|
||||
@@ -36,15 +36,20 @@ const scroll = (
|
||||
};
|
||||
|
||||
const isScrollBehaviorSupported =
|
||||
'scrollBehavior' in document.documentElement.style;
|
||||
"scrollBehavior" in document.documentElement.style;
|
||||
|
||||
export const scrollRight = (node: Element, position: number) => {
|
||||
if (isScrollBehaviorSupported)
|
||||
node.scrollTo({ left: position, behavior: 'smooth' });
|
||||
else scroll(node, 'scrollLeft', position);
|
||||
if (isScrollBehaviorSupported) {
|
||||
node.scrollTo({ left: position, behavior: "smooth" });
|
||||
} else {
|
||||
scroll(node, "scrollLeft", position);
|
||||
}
|
||||
};
|
||||
|
||||
export const scrollTop = (node: Element) => {
|
||||
if (isScrollBehaviorSupported) node.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
else scroll(node, 'scrollTop', 0);
|
||||
if (isScrollBehaviorSupported) {
|
||||
node.scrollTo({ top: 0, behavior: "smooth" });
|
||||
} else {
|
||||
scroll(node, "scrollTop", 0);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user