Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
feat(popover): add optional viewportOnly input
Browse files Browse the repository at this point in the history
  • Loading branch information
garygrossgarten committed Dec 2, 2019
1 parent 0f518e7 commit 7d6bd41
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions projects/core/src/lib/popover/popover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class FivPopover implements OnInit, AfterViewInit, OnDestroy {
@Input() scrollSpeed = 100;
@Input() position: PopoverPositioning = 'auto';
@Input() classes: string[] = [];
@Input() viewportOnly = true;

_position: PopoverPosition;
hidden = false;
Expand Down Expand Up @@ -190,6 +191,9 @@ export class FivPopover implements OnInit, AfterViewInit, OnDestroy {
}

private watchResize(target: HTMLElement) {
if (!this.viewportOnly) {
return;
}
fromEvent(window, 'resize')
.pipe(
flatMap(() => this.filterInViewport(target)),
Expand All @@ -202,6 +206,9 @@ export class FivPopover implements OnInit, AfterViewInit, OnDestroy {
}

private watchScroll(target: HTMLElement) {
if (!this.viewportOnly) {
return;
}
if (this.content && !this.backdrop) {
this.content.scrollEvents = true;
merge(
Expand Down

0 comments on commit 7d6bd41

Please sign in to comment.