1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-02-22 12:40:31 +01:00

Formatting

This commit is contained in:
squidfunk 2020-03-29 14:01:27 +02:00
parent 7b6ce2a913
commit 7e42f78e92
2 changed files with 5 additions and 5 deletions
src/assets/javascripts/components/main/react

@ -88,8 +88,8 @@ export function watchMain(
shareReplay(1) shareReplay(1)
) )
/* Compute the main area's top and bottom markers */ /* Compute the main area's top and bottom borders */
const marker$ = adjust$ const border$ = adjust$
.pipe( .pipe(
switchMap(() => watchElementSize(el) switchMap(() => watchElementSize(el)
.pipe( .pipe(
@ -104,7 +104,7 @@ export function watchMain(
) )
/* Compute the main area's offset, visible height and if we scrolled past */ /* Compute the main area's offset, visible height and if we scrolled past */
return combineLatest([adjust$, marker$, viewport$]) return combineLatest([adjust$, border$, viewport$])
.pipe( .pipe(
map(([header, { top, bottom }, { offset: { y }, size: { height } }]) => { map(([header, { top, bottom }, { offset: { y }, size: { height } }]) => {
height = Math.max(0, height height = Math.max(0, height
@ -114,7 +114,7 @@ export function watchMain(
return { return {
offset: top - header, offset: top - header,
height, height,
active: y >= top - header active: top - header <= y
} }
}), }),
distinctUntilChanged<Main>((a, b) => { distinctUntilChanged<Main>((a, b) => {