REFACTOR Cleaning useless code
This commit is contained in:
parent
51b7104e37
commit
cc956f523a
|
|
@ -51,7 +51,6 @@ export function toggleActiveTabPanel(dataIndex: string): void {
|
|||
// ********************************************************
|
||||
|
||||
function observeSommaireLinks(): void {
|
||||
console.log('observeSommaireLinks');
|
||||
const sommaireTitles: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
|
||||
for (const title of sommaireTitles) {
|
||||
title.addEventListener('click', (e) => {
|
||||
|
|
@ -75,8 +74,6 @@ function toggleActiveChapterLinkInIndexPanel(targetId: string): void {
|
|||
const indexPanel = document.querySelector('.index-panel') as HTMLElement;
|
||||
const currentLink = indexPanel.querySelector(`a[href="#${targetId}"]`) as HTMLElement;
|
||||
|
||||
console.log(currentLink);
|
||||
|
||||
if (!currentLink) return;
|
||||
|
||||
for (const link of sommaireLinks) {
|
||||
|
|
@ -86,23 +83,6 @@ function toggleActiveChapterLinkInIndexPanel(targetId: string): void {
|
|||
currentLink?.setAttribute('active', 'true');
|
||||
}
|
||||
|
||||
// export function handleSmoothScrollToTitle(): void {
|
||||
// const sommaireTitles: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
|
||||
// for (const title of sommaireTitles) {
|
||||
// title.addEventListener('click', (e) => {
|
||||
// e.preventDefault();
|
||||
|
||||
// const target = title.getAttribute('href');
|
||||
// if (!target) return;
|
||||
|
||||
// const targetElement = document.querySelector(target);
|
||||
// if (!targetElement) return;
|
||||
|
||||
// targetElement.scrollIntoView({ behavior: 'smooth' });
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// ********************************************************
|
||||
// ************* FOOTNOTES *********************************
|
||||
// ********************************************************
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user