Browse Source
[matrix] Fix JS errors on search results page
pull/5778/head
Josh
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
2 deletions
-
docs/_static/custom.js
-
docs/_static/sidebar.js
|
|
@ -25,7 +25,7 @@ class Modal { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class Search { |
|
|
|
class SearchBar { |
|
|
|
|
|
|
|
constructor() { |
|
|
|
this.box = document.querySelector('nav.mobile-only'); |
|
|
@ -50,7 +50,7 @@ class Search { |
|
|
|
} |
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
|
mobileSearch = new Search(); |
|
|
|
mobileSearch = new SearchBar(); |
|
|
|
|
|
|
|
bottomHeightThreshold = document.documentElement.scrollHeight - 30; |
|
|
|
sections = document.querySelectorAll('section'); |
|
|
|
|
|
@ -23,6 +23,9 @@ class Sidebar { |
|
|
|
|
|
|
|
createCollapsableSections() { |
|
|
|
let toc = this.element.querySelector('ul'); |
|
|
|
if (!toc) { |
|
|
|
return |
|
|
|
} |
|
|
|
let allReferences = toc.querySelectorAll('a.reference.internal:not([href="#"])'); |
|
|
|
|
|
|
|
for (let ref of allReferences) { |
|
|
|