mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
vdoc: fix search in README index.html
when generated with v doc -f html -m -readme
flags (#21506)
This commit is contained in:
parent
58a8fc6c13
commit
8a515c03b8
1 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,9 @@
|
||||||
function setupScrollSpy() {
|
function setupScrollSpy() {
|
||||||
const mainContent = document.querySelector('#main-content');
|
const mainContent = document.querySelector('#main-content');
|
||||||
const toc = mainContent.querySelector('.doc-toc');
|
const toc = mainContent.querySelector('.doc-toc');
|
||||||
|
if (!toc) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const sections = mainContent.querySelectorAll('section');
|
const sections = mainContent.querySelectorAll('section');
|
||||||
const sectionPositions = Array.from(sections).map((section) => section.offsetTop);
|
const sectionPositions = Array.from(sections).map((section) => section.offsetTop);
|
||||||
let lastActive = null;
|
let lastActive = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue