fixed auto-expand of table of contents on scroll
This commit is contained in:
parent
3323e40aea
commit
8f36b6bbe0
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue