@salesforcedevs/docs-components 1.3.106-alpha.0 → 1.3.106-alpha.2
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
|
@@ -185,6 +185,10 @@ export default class ContentLayout extends LightningElement {
|
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
+
/*
|
|
189
|
+
This is a workaround for the global nav sticky header being decoupled from the doc header & doc phase.
|
|
190
|
+
We have to account for the global nav changing height due to animations.
|
|
191
|
+
*/
|
|
188
192
|
adjustNavPosition = () => {
|
|
189
193
|
const sidebarType = this.useOldSidebar
|
|
190
194
|
? "dx-sidebar-old"
|
|
@@ -196,19 +200,42 @@ export default class ContentLayout extends LightningElement {
|
|
|
196
200
|
const contextNavEl = document.querySelector(
|
|
197
201
|
"hgf-c360contextnav"
|
|
198
202
|
) as HTMLElement;
|
|
199
|
-
const docHeaderEl = document.querySelector(
|
|
203
|
+
const docHeaderEl = document.querySelector(
|
|
204
|
+
".sticky-doc-header"
|
|
205
|
+
) as HTMLElement;
|
|
206
|
+
const docPhaseEl = document.querySelector("doc-phase") as HTMLElement;
|
|
200
207
|
|
|
201
208
|
if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
|
|
202
209
|
console.warn("One or more required elements are missing.");
|
|
203
210
|
return;
|
|
204
211
|
}
|
|
205
212
|
|
|
206
|
-
const
|
|
207
|
-
globalNavEl.offsetHeight +
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
const globalNavHeight =
|
|
214
|
+
globalNavEl.offsetHeight + contextNavEl.offsetHeight;
|
|
215
|
+
const docHeaderHeight = docHeaderEl.offsetHeight;
|
|
216
|
+
|
|
217
|
+
sidebarEl.style.setProperty(
|
|
218
|
+
"--dx-c-content-sidebar-sticky-top",
|
|
219
|
+
`${globalNavHeight + docHeaderHeight}px`
|
|
220
|
+
);
|
|
221
|
+
docHeaderEl.style.setProperty(
|
|
222
|
+
"--dx-g-global-header-height",
|
|
223
|
+
`${globalNavHeight}px`
|
|
224
|
+
);
|
|
210
225
|
|
|
211
|
-
|
|
226
|
+
// If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
|
|
227
|
+
if (docPhaseEl) {
|
|
228
|
+
docPhaseEl.style.setProperty(
|
|
229
|
+
"--doc-c-phase-top",
|
|
230
|
+
`${
|
|
231
|
+
window.innerWidth <= 769
|
|
232
|
+
? globalNavHeight +
|
|
233
|
+
docHeaderHeight +
|
|
234
|
+
sidebarEl.offsetHeight
|
|
235
|
+
: globalNavHeight + docHeaderHeight
|
|
236
|
+
}px`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
212
239
|
};
|
|
213
240
|
|
|
214
241
|
updateHighlighted = (event: Event): void =>
|