@salesforcedevs/docs-components
Advanced tools
Comparing version 1.3.282-scroll-fix-alpha1 to 1.3.282-scroll-fix-alpha2
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "1.3.282-scroll-fix-alpha1", | ||
"version": "1.3.282-scroll-fix-alpha2", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -234,2 +234,9 @@ /* eslint-disable @lwc/lwc/no-document-query */ | ||
const docHeaderHeight = docHeaderEl.getBoundingClientRect().height; | ||
const totalHeaderHeight = globalNavHeight + docHeaderHeight; | ||
const docHeadingEls = Array.from( | ||
document.querySelectorAll("doc-heading") | ||
); | ||
const rightNavBarEl = this.template.querySelector(".right-nav-bar"); | ||
sidebarEl.style.setProperty( | ||
@@ -240,11 +247,21 @@ "--dx-c-content-sidebar-sticky-top", | ||
docHeaderEl.style.setProperty( | ||
"--dx-g-global-header-height", | ||
`${globalNavHeight}px` | ||
); | ||
docHeadingEls.forEach((docHeadingEl) => { | ||
(docHeadingEl as any).style.scrollMarginTop = docPhaseEl | ||
? `${ | ||
totalHeaderHeight + | ||
docPhaseEl.getBoundingClientRect().height | ||
}px` | ||
: `${totalHeaderHeight + 30}px`; | ||
}); | ||
const rnbEl = this.template.querySelector(".right-nav-bar"); | ||
if (rnbEl) { | ||
rnbEl.style.top = `${globalNavHeight + docHeaderHeight + 30}px`; | ||
if (rightNavBarEl) { | ||
rightNavBarEl.style.setProperty( | ||
"--dx-c-content-sidebar-sticky-top", | ||
docPhaseEl | ||
? `${ | ||
totalHeaderHeight + | ||
docPhaseEl.getBoundingClientRect().height | ||
}px` | ||
: `${totalHeaderHeight}px` | ||
); | ||
} | ||
@@ -264,26 +281,2 @@ | ||
); | ||
// Adjust scroll margin for doc headings when doc phase is present | ||
const docHeadingEls = Array.from( | ||
document.querySelectorAll("doc-heading") | ||
); | ||
docHeadingEls.forEach((docHeadingEl) => { | ||
(docHeadingEl as any).style.scrollMarginTop = `${ | ||
globalNavHeight + | ||
docHeaderHeight + | ||
docPhaseEl.getBoundingClientRect().height | ||
}px`; | ||
}); | ||
// Adjust right nav bar position when doc phase is present | ||
const rightNavBarEl = | ||
this.template.querySelector(".right-nav-bar"); | ||
if (rightNavBarEl) { | ||
rightNavBarEl.style.top = `${ | ||
globalNavHeight + | ||
docHeaderHeight + | ||
docPhaseEl.getBoundingClientRect().height | ||
}px`; | ||
} | ||
} | ||
@@ -290,0 +283,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254073
6518