@progressive-development/pd-page 0.1.17 → 0.1.18
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 +1 -1
- package/src/PdMenu.js +4 -1
package/package.json
CHANGED
package/src/PdMenu.js
CHANGED
|
@@ -175,10 +175,12 @@ export class PdMenu extends LitElement {
|
|
|
175
175
|
menuItems: { type: Array },
|
|
176
176
|
topMenuItems: { type: Array },
|
|
177
177
|
teaserClosed: { type: Boolean }, // TODO: Definiert um scroll position anzugleichen, unabhängiger machen...
|
|
178
|
+
scrollFix: { type: Number }, // fix scrollposition (for margin/padding/fixed content reasons)
|
|
178
179
|
_activeSecIndex: { type: Number },
|
|
179
180
|
_smallScreen: { type: Boolean, state: true },
|
|
180
181
|
_activeBurgerMenu: { type: Boolean, reflect: true },
|
|
181
182
|
|
|
183
|
+
|
|
182
184
|
};
|
|
183
185
|
}
|
|
184
186
|
|
|
@@ -190,6 +192,7 @@ export class PdMenu extends LitElement {
|
|
|
190
192
|
|
|
191
193
|
this._activeSecIndex = 0;
|
|
192
194
|
this._activeBurgerMenu = false;
|
|
195
|
+
this.scrollFix = 30;
|
|
193
196
|
}
|
|
194
197
|
|
|
195
198
|
firstUpdated() {
|
|
@@ -316,7 +319,7 @@ export class PdMenu extends LitElement {
|
|
|
316
319
|
const rect = el.getBoundingClientRect();
|
|
317
320
|
// https://www.mediaevent.de/javascript/scroll.html
|
|
318
321
|
window.scrollBy({
|
|
319
|
-
top: rect.top - (this.teaserClosed ?
|
|
322
|
+
top: rect.top - (this.teaserClosed ? this.scrollFix : (350 - this.scrollFix)),
|
|
320
323
|
left: 0,
|
|
321
324
|
behavior: 'smooth',
|
|
322
325
|
});
|