@progressive-development/pd-page 0.1.27 → 0.1.28

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/PdMenu.js +6 -7
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Progressive development page helper, teaser, menu, footer.",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.1.27",
6
+ "version": "0.1.28",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
package/src/PdMenu.js CHANGED
@@ -184,9 +184,9 @@ export class PdMenu extends LitElement {
184
184
  static get properties() {
185
185
  return {
186
186
  menuItems: { type: Array },
187
- topMenuItems: { type: Array },
188
- teaserClosed: { type: Boolean }, // TODO: Definiert um scroll position anzugleichen, unabhängiger machen...
189
- scrollFix: { type: Number }, // fix scrollposition (for margin/padding/fixed content reasons)
187
+ topMenuItems: { type: Array },
188
+ // At the moment needed for scroll to pistion => Refactor possible?
189
+ headerSize: { type: Number },
190
190
  _activeSecIndex: { type: Number },
191
191
  _smallScreen: { type: Boolean, state: true },
192
192
  _activeBurgerMenu: { type: Boolean, reflect: true },
@@ -199,11 +199,9 @@ export class PdMenu extends LitElement {
199
199
  super();
200
200
  this.menuItems = [];
201
201
  this.topMenuItems = [];
202
- this.teaserClosed = false;
203
-
204
202
  this._activeSecIndex = 0;
205
203
  this._activeBurgerMenu = false;
206
- this.scrollFix = 30;
204
+ this.headerSize = 0;
207
205
  }
208
206
 
209
207
  firstUpdated() {
@@ -335,6 +333,7 @@ export class PdMenu extends LitElement {
335
333
  }
336
334
 
337
335
  _scrollToContent(section) {
336
+
338
337
  // check reference
339
338
  const selMenuItem =
340
339
  this.menuItems.filter(item => item.sec === section)[0] || {};
@@ -343,7 +342,7 @@ export class PdMenu extends LitElement {
343
342
  const rect = el.getBoundingClientRect();
344
343
  // https://www.mediaevent.de/javascript/scroll.html
345
344
  window.scrollBy({
346
- top: rect.top - (this.teaserClosed ? this.scrollFix : (350 + this.scrollFix)),
345
+ top: rect.top - (this.headerSize),
347
346
  left: 0,
348
347
  behavior: 'smooth',
349
348
  });