mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-13 09:19:48 +00:00
[matrix] Fix JS errors on search results page
This commit is contained in:
parent
512d9aaccb
commit
3b90e2e74e
4
docs/_static/custom.js
vendored
4
docs/_static/custom.js
vendored
@ -25,7 +25,7 @@ class Modal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Search {
|
class SearchBar {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.box = document.querySelector('nav.mobile-only');
|
this.box = document.querySelector('nav.mobile-only');
|
||||||
@ -50,7 +50,7 @@ class Search {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
mobileSearch = new Search();
|
mobileSearch = new SearchBar();
|
||||||
|
|
||||||
bottomHeightThreshold = document.documentElement.scrollHeight - 30;
|
bottomHeightThreshold = document.documentElement.scrollHeight - 30;
|
||||||
sections = document.querySelectorAll('section');
|
sections = document.querySelectorAll('section');
|
||||||
|
3
docs/_static/sidebar.js
vendored
3
docs/_static/sidebar.js
vendored
@ -23,6 +23,9 @@ class Sidebar {
|
|||||||
|
|
||||||
createCollapsableSections() {
|
createCollapsableSections() {
|
||||||
let toc = this.element.querySelector('ul');
|
let toc = this.element.querySelector('ul');
|
||||||
|
if (!toc) {
|
||||||
|
return
|
||||||
|
}
|
||||||
let allReferences = toc.querySelectorAll('a.reference.internal:not([href="#"])');
|
let allReferences = toc.querySelectorAll('a.reference.internal:not([href="#"])');
|
||||||
|
|
||||||
for (let ref of allReferences) {
|
for (let ref of allReferences) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user