mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Improved rendering performance by omitting unnecessary emits for hero and tabs
This commit is contained in:
parent
155ce0a268
commit
e5f20b540d
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/bundle.ed8df680.min.js.map
Normal file
1
material/assets/javascripts/bundle.ed8df680.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.f34104ec.min.js",
|
"assets/javascripts/bundle.js": "assets/javascripts/bundle.ed8df680.min.js",
|
||||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.f34104ec.min.js.map",
|
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.ed8df680.min.js.map",
|
||||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.c1fcc1cc.min.js",
|
"assets/javascripts/vendor.js": "assets/javascripts/vendor.c1fcc1cc.min.js",
|
||||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.c1fcc1cc.min.js.map",
|
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.c1fcc1cc.min.js.map",
|
||||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.3bc815f0.min.js",
|
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.3bc815f0.min.js",
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/vendor.c1fcc1cc.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/vendor.c1fcc1cc.min.js' | url }}"></script>
|
||||||
<script src="{{ 'assets/javascripts/bundle.f34104ec.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.ed8df680.min.js' | url }}"></script>
|
||||||
{%- set translations = {} -%}
|
{%- set translations = {} -%}
|
||||||
{%- for key in [
|
{%- for key in [
|
||||||
"clipboard.copy",
|
"clipboard.copy",
|
||||||
|
@ -21,7 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable, OperatorFunction, pipe } from "rxjs"
|
import { Observable, OperatorFunction, pipe } from "rxjs"
|
||||||
import { distinctUntilChanged, map, switchMap } from "rxjs/operators"
|
import {
|
||||||
|
distinctUntilKeyChanged,
|
||||||
|
map,
|
||||||
|
switchMap
|
||||||
|
} from "rxjs/operators"
|
||||||
|
|
||||||
import { Viewport, watchViewportAt } from "browser"
|
import { Viewport, watchViewportAt } from "browser"
|
||||||
|
|
||||||
@ -69,7 +73,7 @@ export function mountHero(
|
|||||||
switchMap(el => watchViewportAt(el, { header$, viewport$ })
|
switchMap(el => watchViewportAt(el, { header$, viewport$ })
|
||||||
.pipe(
|
.pipe(
|
||||||
map(({ offset: { y } }) => ({ hidden: y >= 20 })),
|
map(({ offset: { y } }) => ({ hidden: y >= 20 })),
|
||||||
distinctUntilChanged(),
|
distinctUntilKeyChanged("hidden"),
|
||||||
applyHero(el)
|
applyHero(el)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable, OperatorFunction, of, pipe } from "rxjs"
|
import { Observable, OperatorFunction, of, pipe } from "rxjs"
|
||||||
import { distinctUntilChanged, map, switchMap } from "rxjs/operators"
|
import {
|
||||||
|
distinctUntilKeyChanged,
|
||||||
|
map,
|
||||||
|
switchMap
|
||||||
|
} from "rxjs/operators"
|
||||||
|
|
||||||
import { Viewport, watchViewportAt } from "browser"
|
import { Viewport, watchViewportAt } from "browser"
|
||||||
|
|
||||||
@ -76,7 +80,7 @@ export function mountTabs(
|
|||||||
return watchViewportAt(el, { header$, viewport$ })
|
return watchViewportAt(el, { header$, viewport$ })
|
||||||
.pipe(
|
.pipe(
|
||||||
map(({ offset: { y } }) => ({ hidden: y >= 10 })),
|
map(({ offset: { y } }) => ({ hidden: y >= 10 })),
|
||||||
distinctUntilChanged(),
|
distinctUntilKeyChanged("hidden"),
|
||||||
applyTabs(el)
|
applyTabs(el)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user