From 7e42f78e9220aec22fae8ac0b3dcd894e6dfb508 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 29 Mar 2020 14:01:27 +0200 Subject: [PATCH] Formatting --- src/assets/javascripts/components/main/react/index.ts | 8 ++++---- src/assets/javascripts/components/toc/_/index.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/assets/javascripts/components/main/react/index.ts b/src/assets/javascripts/components/main/react/index.ts index d4caaf970..bb24ca8fa 100644 --- a/src/assets/javascripts/components/main/react/index.ts +++ b/src/assets/javascripts/components/main/react/index.ts @@ -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
((a, b) => { diff --git a/src/assets/javascripts/components/toc/_/index.ts b/src/assets/javascripts/components/toc/_/index.ts index e8cb34159..c59aee846 100644 --- a/src/assets/javascripts/components/toc/_/index.ts +++ b/src/assets/javascripts/components/toc/_/index.ts @@ -96,7 +96,7 @@ interface MountOptions { * @return Operator function */ export function mountTableOfContents( - { header$, main$, viewport$, tablet$}: MountOptions + { header$, main$, viewport$, tablet$ }: MountOptions ): OperatorFunction { return pipe( switchMap(el => tablet$