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

View File

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

View File

@ -96,7 +96,7 @@ interface MountOptions {
* @return Operator function
*/
export function mountTableOfContents(
{ header$, main$, viewport$, tablet$}: MountOptions
{ header$, main$, viewport$, tablet$ }: MountOptions
): OperatorFunction<HTMLElement, TableOfContents> {
return pipe(
switchMap(el => tablet$