@profitlich/template-toolkit 5.2.0 → 5.2.1

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.
@@ -121,15 +121,11 @@ export class MenuToggle {
121
121
  window.addEventListener('resize', this.#resizeHandler);
122
122
  this.#setBodyAttribute('data-menu-moving', 'true');
123
123
  if (!this.#deferPositionFixed) {
124
- this.#fixElement.setAttribute('data-menu-fixed', 'true');
124
+ this.#applyFix();
125
125
  }
126
126
  setTimeout(() => {
127
- this.#scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
128
- this.#y = window.scrollY;
129
- this.#fixElement.style.paddingRight = `${this.#scrollbarWidth}px`;
130
- this.#fixElement.style.top = `-${this.#y}px`;
131
127
  if (this.#deferPositionFixed) {
132
- this.#fixElement.setAttribute('data-menu-fixed', 'true');
128
+ this.#applyFix();
133
129
  }
134
130
  if (this.#shiftElement) {
135
131
  const marginOriginal = parseFloat(window.getComputedStyle(this.#menuButton).marginRight);
@@ -147,6 +143,14 @@ export class MenuToggle {
147
143
  document.dispatchEvent(event);
148
144
  }
149
145
 
146
+ #applyFix() {
147
+ this.#scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
148
+ this.#y = window.scrollY;
149
+ this.#fixElement.style.paddingRight = `${this.#scrollbarWidth}px`;
150
+ this.#fixElement.style.top = `-${this.#y}px`;
151
+ this.#fixElement.setAttribute('data-menu-fixed', 'true');
152
+ }
153
+
150
154
  #adjustShiftElementWidth() {
151
155
  const contentWidth = document.documentElement.clientWidth;
152
156
  this.#shiftElement.style.width = `${contentWidth - this.#scrollbarWidth}px`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profitlich/template-toolkit",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Shared SCSS layout system, JS utilities, components and build scripts for profitlich template repos",
5
5
  "type": "module",
6
6
  "sass": "scss/forward.scss",