@sebgroup/green-angular 1.8.4 → 1.8.5

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.
@@ -313,6 +313,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
313
313
  }]
314
314
  }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
315
315
 
316
+ const CONTEXT_MENU_TOP = '0px';
317
+ const CONTEXT_MENU_LEFT = '0px';
318
+
316
319
  class NggContextMenuComponent {
317
320
  constructor(changeDetectorRef, elementRef, closeContextMenu) {
318
321
  this.changeDetectorRef = changeDetectorRef;
@@ -325,15 +328,14 @@ class NggContextMenuComponent {
325
328
  this.closeOnScroll = false;
326
329
  this.contextMenuItemClicked = new EventEmitter();
327
330
  this.isActive = false;
328
- this.top = '0px';
329
- this.left = '0px';
331
+ this.top = CONTEXT_MENU_TOP;
332
+ this.left = CONTEXT_MENU_LEFT;
330
333
  }
331
334
  onDocumentClick(target) {
332
335
  if (!this.isActive) {
333
336
  return;
334
337
  }
335
- const contextMenuElement = this.elementRef.nativeElement;
336
- if (!contextMenuElement.contains(target)) {
338
+ if (!this.elementRef.nativeElement.contains(target)) {
337
339
  this.close();
338
340
  }
339
341
  }
@@ -357,8 +359,7 @@ class NggContextMenuComponent {
357
359
  this.close();
358
360
  return;
359
361
  }
360
- const anchor = this.anchor?.nativeElement;
361
- const buttonRect = anchor.getBoundingClientRect();
362
+ const buttonRect = this.anchor?.nativeElement.getBoundingClientRect();
362
363
  const gapBetweenButtonAndPopover = 3;
363
364
  const left = this.calculateLeft(this.direction, buttonRect);
364
365
  const top = buttonRect.bottom + gapBetweenButtonAndPopover;
@@ -368,6 +369,8 @@ class NggContextMenuComponent {
368
369
  }
369
370
  close() {
370
371
  this.isActive = false;
372
+ this.top = CONTEXT_MENU_TOP;
373
+ this.left = CONTEXT_MENU_LEFT;
371
374
  this.changeDetectorRef.markForCheck();
372
375
  }
373
376
  onItemClick(item) {
@@ -977,7 +980,12 @@ class NggModalComponent {
977
980
  if (this.trapFocus) {
978
981
  this.enableFocusTrap();
979
982
  }
980
- disableBodyScroll(this.ref.nativeElement);
983
+ disableBodyScroll(this.ref.nativeElement, {
984
+ allowTouchMove: (el) => {
985
+ // Allow touchmove for elements inside modal, its required for scroll to work on iOS devices
986
+ return this.ref.nativeElement.contains(el);
987
+ }
988
+ });
981
989
  }
982
990
  else {
983
991
  this.disableFocusTrap();