mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed active layer reset
This commit is contained in:
parent
653426257e
commit
6dba046eae
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/bundle.abf20a04.min.js.map
Normal file
1
material/assets/javascripts/bundle.abf20a04.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.de72e519.min.js",
|
"assets/javascripts/bundle.js": "assets/javascripts/bundle.abf20a04.min.js",
|
||||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.de72e519.min.js.map",
|
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.abf20a04.min.js.map",
|
||||||
"assets/javascripts/worker/packer.js": "assets/javascripts/worker/packer.819c2a16.min.js",
|
"assets/javascripts/worker/packer.js": "assets/javascripts/worker/packer.819c2a16.min.js",
|
||||||
"assets/javascripts/worker/packer.js.map": "assets/javascripts/worker/packer.819c2a16.min.js.map",
|
"assets/javascripts/worker/packer.js.map": "assets/javascripts/worker/packer.819c2a16.min.js.map",
|
||||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.e2455911.min.js",
|
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.03c9bfda.min.js",
|
||||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.e2455911.min.js.map",
|
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.03c9bfda.min.js.map",
|
||||||
"assets/stylesheets/app-palette.scss": "assets/stylesheets/app-palette.8c25017f.min.css",
|
"assets/stylesheets/app-palette.scss": "assets/stylesheets/app-palette.8c25017f.min.css",
|
||||||
"assets/stylesheets/app.scss": "assets/stylesheets/app.44d84311.min.css"
|
"assets/stylesheets/app.scss": "assets/stylesheets/app.44d84311.min.css"
|
||||||
}
|
}
|
@ -188,7 +188,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.de72e519.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.abf20a04.min.js' | url }}"></script>
|
||||||
<script id="__lang" type="application/json">
|
<script id="__lang" type="application/json">
|
||||||
{%- set translations = {} -%}
|
{%- set translations = {} -%}
|
||||||
{%- for key in [
|
{%- for key in [
|
||||||
@ -207,7 +207,7 @@
|
|||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
{{ translations | tojson }}
|
{{ translations | tojson }}
|
||||||
</script>
|
</script>
|
||||||
<script>app=initialize({base:"{{ base_url }}",worker:{search:"{{ 'assets/javascripts/worker/search.e2455911.min.js' | url }}",packer:"{{ 'assets/javascripts/worker/packer.819c2a16.min.js' | url }}"}})</script>
|
<script>app=initialize({base:"{{ base_url }}",worker:{search:"{{ 'assets/javascripts/worker/search.03c9bfda.min.js' | url }}",packer:"{{ 'assets/javascripts/worker/packer.819c2a16.min.js' | url }}"}})</script>
|
||||||
{% for path in config["extra_javascript"] %}
|
{% for path in config["extra_javascript"] %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<label class="md-nav__title" for="{{ path }}">
|
<label class="md-nav__title" for="{{ path }}">
|
||||||
{{ nav_item.title }}
|
{{ nav_item.title }}
|
||||||
</label>
|
</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list">
|
||||||
{% set base = path %}
|
{% set base = path %}
|
||||||
{% for nav_item in nav_item.children %}
|
{% for nav_item in nav_item.children %}
|
||||||
{% set path = base + "-" + loop.index | string %}
|
{% set path = base + "-" + loop.index | string %}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
{% include "partials/source.html" %}
|
{% include "partials/source.html" %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list">
|
||||||
{% for nav_item in nav %}
|
{% for nav_item in nav %}
|
||||||
{% set path = "nav-" + loop.index | string %}
|
{% set path = "nav-" + loop.index | string %}
|
||||||
{% set level = 1 %}
|
{% set level = 1 %}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap">
|
||||||
<div class="md-search-result" data-md-component="search-result">
|
<div class="md-search-result" data-md-component="search-result">
|
||||||
<div class="md-search-result__meta">
|
<div class="md-search-result__meta">
|
||||||
{{ lang.t("search.result.placeholder") }}
|
{{ lang.t("search.result.placeholder") }}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if toc_ | first is defined %}
|
{% if toc_ | first is defined %}
|
||||||
<label class="md-nav__title" for="__toc">{{ lang.t("toc.title") }}</label>
|
<label class="md-nav__title" for="__toc">{{ lang.t("toc.title") }}</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list">
|
||||||
{% for toc_item in toc_ %}
|
{% for toc_item in toc_ %}
|
||||||
{% include "partials/toc-item.html" %}
|
{% include "partials/toc-item.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -31,6 +31,7 @@ import {
|
|||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
import {
|
import {
|
||||||
delay,
|
delay,
|
||||||
|
finalize,
|
||||||
map,
|
map,
|
||||||
observeOn,
|
observeOn,
|
||||||
scan,
|
scan,
|
||||||
@ -42,7 +43,7 @@ import {
|
|||||||
resetOverflowScrolling,
|
resetOverflowScrolling,
|
||||||
setOverflowScrolling
|
setOverflowScrolling
|
||||||
} from "actions"
|
} from "actions"
|
||||||
import { getElement, getElements } from "utilities"
|
import { getElement } from "utilities"
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
* Types
|
* Types
|
||||||
@ -65,22 +66,22 @@ export interface ActiveLayer {
|
|||||||
*
|
*
|
||||||
* On iOS we want to add `-webkit-overflow-scrolling: touch` for the menus
|
* On iOS we want to add `-webkit-overflow-scrolling: touch` for the menus
|
||||||
* contained in the drawer, but as the navigational layers are nested, we can
|
* contained in the drawer, but as the navigational layers are nested, we can
|
||||||
* only add it to the active layer because otherwise weird stuff will happen.
|
* only add it to the active layer because otherwise weird cropping will occur.
|
||||||
* This implementation keeps track of the previous and currently active layer.
|
* This implementation keeps track of the previous and currently active layer.
|
||||||
*
|
*
|
||||||
* @param el - Navigation element (top-level)
|
* @param els - Navigation elements
|
||||||
*
|
*
|
||||||
* @return Active layer observable
|
* @return Active layer observable
|
||||||
*/
|
*/
|
||||||
export function watchActiveLayer(
|
export function watchActiveLayer(
|
||||||
el: HTMLElement
|
els: HTMLElement[]
|
||||||
): Observable<ActiveLayer> {
|
): Observable<ActiveLayer> {
|
||||||
const table = new Map<HTMLInputElement, HTMLElement>()
|
const table = new Map<HTMLInputElement, HTMLElement>()
|
||||||
for (const nav of getElements("nav", el)) {
|
for (const el of els) {
|
||||||
const label = getElement<HTMLLabelElement>("label", nav)
|
const label = getElement<HTMLLabelElement>("label", el)
|
||||||
if (typeof label !== "undefined") {
|
if (typeof label !== "undefined") {
|
||||||
const input = getElement<HTMLInputElement>(`#${label.htmlFor}`)!
|
const input = getElement<HTMLInputElement>(`#${label.htmlFor}`)!
|
||||||
table.set(input, nav)
|
table.set(input, el)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,23 +109,34 @@ export function watchActiveLayer(
|
|||||||
/**
|
/**
|
||||||
* Paint active layer from source observable
|
* Paint active layer from source observable
|
||||||
*
|
*
|
||||||
* @param els - Anchor elements
|
* @param els - Navigation elements
|
||||||
*
|
*
|
||||||
* @return Operator function
|
* @return Operator function
|
||||||
*/
|
*/
|
||||||
export function paintActiveLayer(): MonoTypeOperatorFunction<ActiveLayer> {
|
export function paintActiveLayer(
|
||||||
|
els: HTMLElement[]
|
||||||
|
): MonoTypeOperatorFunction<ActiveLayer> {
|
||||||
return pipe(
|
return pipe(
|
||||||
|
|
||||||
/* Unset overflow scrolling on previous layer */
|
/* Defer repaint to next animation frame */
|
||||||
observeOn(animationFrameScheduler),
|
observeOn(animationFrameScheduler),
|
||||||
tap(({ prev }) => {
|
tap(({ prev }) => {
|
||||||
if (prev) resetOverflowScrolling(prev)
|
if (prev)
|
||||||
|
resetOverflowScrolling(prev)
|
||||||
|
}),
|
||||||
|
|
||||||
|
/* Reset on complete or error */
|
||||||
|
finalize(() => {
|
||||||
|
for (const el of els)
|
||||||
|
resetOverflowScrolling(
|
||||||
|
getElement(".md-nav__list", el)!
|
||||||
|
)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/* Wait until transition has finished */
|
/* Wait until transition has finished */
|
||||||
delay(250),
|
delay(250),
|
||||||
|
|
||||||
/* Set overflow scrolling on next layer */
|
/* Defer repaint to next animation frame */
|
||||||
observeOn(animationFrameScheduler),
|
observeOn(animationFrameScheduler),
|
||||||
tap(({ next }) => {
|
tap(({ next }) => {
|
||||||
setOverflowScrolling(next)
|
setOverflowScrolling(next)
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<label class="md-nav__title" for="{{ path }}">
|
<label class="md-nav__title" for="{{ path }}">
|
||||||
{{ nav_item.title }}
|
{{ nav_item.title }}
|
||||||
</label>
|
</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list">
|
||||||
|
|
||||||
<!-- Render nested item list -->
|
<!-- Render nested item list -->
|
||||||
{% set base = path %}
|
{% set base = path %}
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Render item list -->
|
<!-- Render item list -->
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list">
|
||||||
{% for nav_item in nav %}
|
{% for nav_item in nav %}
|
||||||
{% set path = "nav-" + loop.index | string %}
|
{% set path = "nav-" + loop.index | string %}
|
||||||
{% set level = 1 %}
|
{% set level = 1 %}
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap">
|
||||||
<div class="md-search-result" data-md-component="search-result">
|
<div class="md-search-result" data-md-component="search-result">
|
||||||
<div class="md-search-result__meta">
|
<div class="md-search-result__meta">
|
||||||
{{ lang.t("search.result.placeholder") }}
|
{{ lang.t("search.result.placeholder") }}
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<!-- Render item list -->
|
<!-- Render item list -->
|
||||||
{% if toc_ | first is defined %}
|
{% if toc_ | first is defined %}
|
||||||
<label class="md-nav__title" for="__toc">{{ lang.t("toc.title") }}</label>
|
<label class="md-nav__title" for="__toc">{{ lang.t("toc.title") }}</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list">
|
||||||
{% for toc_item in toc_ %}
|
{% for toc_item in toc_ %}
|
||||||
{% include "partials/toc-item.html" %}
|
{% include "partials/toc-item.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -150,11 +150,12 @@ function config(args: Configuration): Configuration {
|
|||||||
/* Source maps */
|
/* Source maps */
|
||||||
devtool: "source-map",
|
devtool: "source-map",
|
||||||
|
|
||||||
/* Filter false positives and copied files */
|
/* Filter false positives and omit verbosity */
|
||||||
stats: {
|
stats: {
|
||||||
|
entrypoints: false,
|
||||||
excludeAssets: [
|
excludeAssets: [
|
||||||
/.fontawesome/,
|
/.fontawesome/,
|
||||||
/assets/,
|
/\/(fonts|images|lunr)\//,
|
||||||
/\.(html|py|yml)$/
|
/\.(html|py|yml)$/
|
||||||
],
|
],
|
||||||
warningsFilter: [
|
warningsFilter: [
|
||||||
|
Loading…
Reference in New Issue
Block a user