1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-09 07:25:21 +02:00

sidebar search navigation adjusted

This commit is contained in:
Umang G. Patel 2022-09-06 01:55:27 +05:30
parent 480f79d466
commit 97555e094b

View file

@ -368,10 +368,8 @@ export default class Sidebar {
element.classList.add(Sidebar.CSS.sectionListItemSlelected); element.classList.add(Sidebar.CSS.sectionListItemSlelected);
} }
// find the parent section.
const parentSection = element.closest('section');
// check if it's visible. // check if it's visible.
const rect = parentSection.getBoundingClientRect(); const rect = element.getBoundingClientRect();
let elemTop = rect.top; let elemTop = rect.top;
let elemBottom = rect.bottom; let elemBottom = rect.bottom;
const halfOfViewport = window.innerHeight / 2; const halfOfViewport = window.innerHeight / 2;