@salesforcedevs/docs-components 1.3.120-alpha.2 → 1.3.120-alpha.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.120-alpha.2",
3
+ "version": "1.3.120-alpha.4",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -101,10 +101,6 @@ dx-toc {
101
101
  overflow-x: auto;
102
102
  }
103
103
 
104
- .sidebar-open {
105
- height: 0;
106
- }
107
-
108
104
  .left-nav-bar {
109
105
  height: unset;
110
106
  z-index: 10;
@@ -128,10 +128,7 @@ export default class ContentLayout extends LightningElement {
128
128
  }
129
129
 
130
130
  get contentBodyClass(): string {
131
- return cx(
132
- "content-body-container",
133
- this.sidebarOpen ? "sidebar-open" : ""
134
- );
131
+ return cx("content-body-container");
135
132
  }
136
133
 
137
134
  connectedCallback(): void {
@@ -162,7 +159,6 @@ export default class ContentLayout extends LightningElement {
162
159
  this.adjustNavPosition();
163
160
  window.addEventListener("scroll", this.adjustNavPosition);
164
161
  window.addEventListener("resize", this.adjustNavPosition);
165
- window.addEventListener("resize", this.checkSidebarOpen);
166
162
 
167
163
  if (!this.hasRendered) {
168
164
  this.hasRendered = true;
@@ -178,7 +174,6 @@ export default class ContentLayout extends LightningElement {
178
174
  );
179
175
  window.removeEventListener("scroll", this.adjustNavPosition);
180
176
  window.removeEventListener("resize", this.adjustNavPosition);
181
- window.removeEventListener("resize", this.checkSidebarOpen);
182
177
  this.searchSyncer.dispose();
183
178
  this.clearRenderObserverTimer();
184
179
 
@@ -406,15 +401,11 @@ export default class ContentLayout extends LightningElement {
406
401
  private onToggleSidebar(e: CustomEvent): void {
407
402
  this.sidebarOpen = e.detail.open;
408
403
 
409
- if (e.detail.open) {
410
- window.scrollTo(0, 0);
411
- }
412
- }
404
+ // eslint-disable-next-line @lwc/lwc/no-document-query
405
+ const footer = document.querySelector("dx-footer") as HTMLElement;
413
406
 
414
- // since the content body is set to a height of 0 when the sidebar is open, we need to reset the sidebarOpen state when the window is resized
415
- private checkSidebarOpen = (): void => {
416
- if (window.innerWidth > 769) {
417
- this.sidebarOpen = false;
407
+ if (footer) {
408
+ footer.style.display = this.sidebarOpen ? "none" : "block";
418
409
  }
419
- };
410
+ }
420
411
  }