MCPcopy Create free account
hub / github.com/Rello/analytics / syncActiveSection

Function syncActiveSection

js/userGuidance.js:557–569  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

userGuidance.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected