| 555 | } |
| 556 | |
| 557 | const syncActiveSection = function () { |
| 558 | const panelPaddingTop = parseInt(window.getComputedStyle(panel).paddingTop, 10) || 0; |
| 559 | const panelTop = panel.scrollTop + panelPaddingTop + sectionScrollOffset; |
| 560 | let activeSectionId = sections[0].id; |
| 561 | |
| 562 | sections.forEach((section) => { |
| 563 | if (section.offsetTop <= panelTop) { |
| 564 | activeSectionId = section.id; |
| 565 | } |
| 566 | }); |
| 567 | |
| 568 | OCA.Analytics.Notification.updateEnhancedDialogActiveSection(navLinks, activeSectionId); |
| 569 | }; |
| 570 | |
| 571 | panel.addEventListener('scroll', syncActiveSection, {passive: true}); |
| 572 | syncActiveSection(); |