1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 15:40:15 +01:00

Fixed closing of search results on anchor jump

This commit is contained in:
squidfunk 2020-03-12 17:13:31 +01:00
parent 566b1363ee
commit c0abaf5692
6 changed files with 14 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"assets/javascripts/bundle.js": "assets/javascripts/bundle.63b8430f.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.63b8430f.min.js.map",
"assets/javascripts/bundle.js": "assets/javascripts/bundle.21a66646.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.21a66646.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.b0b43276.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.b0b43276.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.784c5235.min.js",

View File

@ -178,7 +178,7 @@
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/vendor.b0b43276.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.63b8430f.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.21a66646.min.js' | url }}"></script>
{%- set translations = {} -%}
{%- for key in [
"clipboard.copy",

View File

@ -57,7 +57,8 @@ import {
watchLocationHash,
watchViewport,
isLocationInternal,
isLocationAnchor
isLocationAnchor,
setLocationHash
} from "./browser"
import { setupSearchWorker } from "./workers"
@ -270,20 +271,12 @@ export function initialize(config: unknown) {
/* ----------------------------------------------------------------------- */
// // put into search...
// hash$
// .pipe(
// switchMap(hash => useToggle("search")
// .pipe(
// filter(x => x.checked), // only active
// tap(toggle => setToggle(toggle, false)),
// delay(125), // ensure that it runs after the body scroll reset...
// mapTo(hash)
// )
// )
// )
// .subscribe(hash => {
// getElement(`[id="${hash}"]`)!.scrollIntoView()
// })
hash$
.pipe(
tap(() => setToggle("search", false)),
delay(125), // ensure that it runs after the body scroll reset...
)
.subscribe(hash => setLocationHash(`#${hash}`)) // TODO: must be unified
// Scroll lock // document -> document$ => { body } !?
// put into search...