|
|
|
@ -1,3 +1,19 @@
|
|
|
|
|
/*
|
|
|
|
|
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Account for id attributes that are in the sidebar nav
|
|
|
|
|
*/
|
|
|
|
@ -125,7 +141,6 @@
|
|
|
|
|
let previousLi = null;
|
|
|
|
|
let i = index;
|
|
|
|
|
const lis = [];
|
|
|
|
|
|
|
|
|
|
for (i; i < headings.length; i++) {
|
|
|
|
|
const thisHeading = headings[i];
|
|
|
|
|
if (previousHeading && (thisHeading.tagName > previousHeading.tagName)) {
|
|
|
|
@ -172,7 +187,6 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newEntry.classList.add('active');
|
|
|
|
|
|
|
|
|
|
// don't scroll the sidebar nav if the main content is not scrolled
|
|
|
|
|
const nav = document.querySelector("#td-section-nav");
|
|
|
|
|
const content = document.querySelector("html");
|
|
|
|
@ -188,7 +202,6 @@
|
|
|
|
|
*/
|
|
|
|
|
function isInViewport(node) {
|
|
|
|
|
const rect = node.getBoundingClientRect();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
rect.top >= 0 &&
|
|
|
|
|
rect.left >= 0 &&
|
|
|
|
|