@salesforcedevs/docs-components 1.3.300-scroll-fix-alpha2 → 1.3.300-scroll-fix-alpha3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -233,6 +233,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
233
233
|
const docHeaderHeight = docHeaderEl.getBoundingClientRect().height;
|
|
234
234
|
const totalHeaderHeight = globalNavHeight + docHeaderHeight;
|
|
235
235
|
|
|
236
|
+
// Selecting the doc section heading and RNB here.
|
|
236
237
|
const docHeadingEls = Array.from(
|
|
237
238
|
document.querySelectorAll("doc-heading")
|
|
238
239
|
);
|
|
@@ -243,6 +244,12 @@ export default class ContentLayout extends LightningElement {
|
|
|
243
244
|
`${globalNavHeight + docHeaderHeight}px`
|
|
244
245
|
);
|
|
245
246
|
|
|
247
|
+
docHeaderEl.style.setProperty(
|
|
248
|
+
"--dx-g-global-header-height",
|
|
249
|
+
`${globalNavHeight}px`
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
// Adjusting the doc section heading on scroll.
|
|
246
253
|
docHeadingEls.forEach((docHeadingEl) => {
|
|
247
254
|
(docHeadingEl as any).style.scrollMarginTop = docPhaseEl
|
|
248
255
|
? `${
|
|
@@ -252,16 +259,14 @@ export default class ContentLayout extends LightningElement {
|
|
|
252
259
|
: `${totalHeaderHeight + 30}px`;
|
|
253
260
|
});
|
|
254
261
|
|
|
262
|
+
// Adjusting the right nav bar on scroll.
|
|
255
263
|
if (rightNavBarEl) {
|
|
256
|
-
rightNavBarEl.style.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}px`
|
|
263
|
-
: `${totalHeaderHeight}px`
|
|
264
|
-
);
|
|
264
|
+
rightNavBarEl.style.top = docPhaseEl
|
|
265
|
+
? `${
|
|
266
|
+
totalHeaderHeight +
|
|
267
|
+
docPhaseEl.getBoundingClientRect().height
|
|
268
|
+
}px`
|
|
269
|
+
: `${totalHeaderHeight}px`;
|
|
265
270
|
}
|
|
266
271
|
|
|
267
272
|
// If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
|