mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 03:26:09 +00:00
File diff suppressed because one or more lines are too long
@@ -38,10 +38,19 @@
|
|||||||
* So the first one with positive bounding rect top will be the nearest next header
|
* So the first one with positive bounding rect top will be the nearest next header
|
||||||
*/
|
*/
|
||||||
if (currNavActive && i < headings.length - 1) {
|
if (currNavActive && i < headings.length - 1) {
|
||||||
const next = headings[i + 1].href.split('#')[1];
|
const heading = headings[i + 1];
|
||||||
|
const next = decodeURIComponent(heading.href.split('#')[1]);
|
||||||
const nextHeader = document.getElementById(next);
|
const nextHeader = document.getElementById(next);
|
||||||
const top = nextHeader.getBoundingClientRect().top;
|
|
||||||
currNavActive = top > OFFSET;
|
if (nextHeader) {
|
||||||
|
const top = nextHeader.getBoundingClientRect().top;
|
||||||
|
currNavActive = top > OFFSET;
|
||||||
|
} else {
|
||||||
|
console.error('Can not find header element', {
|
||||||
|
id: next,
|
||||||
|
heading,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Stop searching once a first such header is found,
|
* Stop searching once a first such header is found,
|
||||||
@@ -56,6 +65,7 @@
|
|||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener('scroll', onScroll);
|
document.addEventListener('scroll', onScroll);
|
||||||
document.addEventListener('resize', onScroll);
|
document.addEventListener('resize', onScroll);
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user