REFACTOR Cleaning useless code

This commit is contained in:
Nonimart 2025-06-24 15:23:33 +02:00
parent 51b7104e37
commit cc956f523a

View File

@ -51,7 +51,6 @@ export function toggleActiveTabPanel(dataIndex: string): void {
// ******************************************************** // ********************************************************
function observeSommaireLinks(): void { function observeSommaireLinks(): void {
console.log('observeSommaireLinks');
const sommaireTitles: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a'); const sommaireTitles: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
for (const title of sommaireTitles) { for (const title of sommaireTitles) {
title.addEventListener('click', (e) => { title.addEventListener('click', (e) => {
@ -75,8 +74,6 @@ function toggleActiveChapterLinkInIndexPanel(targetId: string): void {
const indexPanel = document.querySelector('.index-panel') as HTMLElement; const indexPanel = document.querySelector('.index-panel') as HTMLElement;
const currentLink = indexPanel.querySelector(`a[href="#${targetId}"]`) as HTMLElement; const currentLink = indexPanel.querySelector(`a[href="#${targetId}"]`) as HTMLElement;
console.log(currentLink);
if (!currentLink) return; if (!currentLink) return;
for (const link of sommaireLinks) { for (const link of sommaireLinks) {
@ -86,23 +83,6 @@ function toggleActiveChapterLinkInIndexPanel(targetId: string): void {
currentLink?.setAttribute('active', 'true'); 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 ********************************* // ************* FOOTNOTES *********************************
// ******************************************************** // ********************************************************