Fixed incorrect active table of contents item when main size changes

This commit is contained in:
squidfunk 2020-03-29 14:00:53 +02:00
parent 6a0e6142e3
commit 7b6ce2a913
6 changed files with 9 additions and 9 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.0ddca959.min.js", "assets/javascripts/bundle.js": "assets/javascripts/bundle.d8f7c943.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.0ddca959.min.js.map", "assets/javascripts/bundle.js.map": "assets/javascripts/bundle.d8f7c943.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",

View File

@ -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.0ddca959.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.d8f7c943.min.js' | url }}"></script>
{%- set translations = {} -%} {%- set translations = {} -%}
{%- for key in [ {%- for key in [
"clipboard.copy", "clipboard.copy",

View File

@ -41,7 +41,7 @@ import {
tap tap
} from "rxjs/operators" } from "rxjs/operators"
import { Viewport, getElement } from "browser" import { Viewport, getElement, watchElementSize } from "browser"
import { Header } from "../../../header" import { Header } from "../../../header"
import { AnchorList } from "../_" import { AnchorList } from "../_"
@ -106,9 +106,9 @@ export function watchAnchorList(
) )
/* Compute partition of previous and next anchors */ /* Compute partition of previous and next anchors */
const partition$ = viewport$ const partition$ = watchElementSize(document.body)
.pipe( .pipe(
distinctUntilKeyChanged("size"), distinctUntilKeyChanged("height"),
/* Build index to map anchor paths to vertical offsets */ /* Build index to map anchor paths to vertical offsets */
map(() => { map(() => {