From 8f36b6bbe03cce2e87eef95ed723132109238dcc Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Fri, 17 May 2024 14:33:27 +0300 Subject: [PATCH] fixed auto-expand of table of contents on scroll --- .../editor/table-of-contents/table-of-contents.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.component.ts b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.component.ts index d6d860445..a44882163 100644 --- a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.component.ts @@ -222,7 +222,8 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O entries.forEach(ie => { if (ie.isIntersecting) { try { - const target_id = ie.target.id.replace(this.TOCENTRY_ID_PREFIX, ''); + // const target_id = ie.target.id.replace(this.TOCENTRY_ID_PREFIX, ''); + const target_id = ie.target.id;//.replace(this.TOCENTRY_ID_PREFIX, ''); if (this.visibilityRulesService.isVisibleMap[target_id] ?? true) { this.onToCentrySelected(this._findTocEntryById(target_id, this.tocentries)); } @@ -238,7 +239,8 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O fieldsetsEtries.forEach(e => { if (e.type === ToCEntryType.FieldSet) { try { - const targetElement = document.getElementById(this.TOCENTRY_ID_PREFIX + e.id); + // const targetElement = document.getElementById(this.TOCENTRY_ID_PREFIX + e.id); + const targetElement = document.getElementById(e.id); this._intersectionObserver.observe(targetElement); } catch { console.log('element not found');