mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Formatting
This commit is contained in:
parent
7b6ce2a913
commit
7e42f78e92
@ -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) => {
|
||||||
|
@ -96,7 +96,7 @@ interface MountOptions {
|
|||||||
* @return Operator function
|
* @return Operator function
|
||||||
*/
|
*/
|
||||||
export function mountTableOfContents(
|
export function mountTableOfContents(
|
||||||
{ header$, main$, viewport$, tablet$}: MountOptions
|
{ header$, main$, viewport$, tablet$ }: MountOptions
|
||||||
): OperatorFunction<HTMLElement, TableOfContents> {
|
): OperatorFunction<HTMLElement, TableOfContents> {
|
||||||
return pipe(
|
return pipe(
|
||||||
switchMap(el => tablet$
|
switchMap(el => tablet$
|
||||||
|
Loading…
x
Reference in New Issue
Block a user