Skip to content

Commit

Permalink
fix(aot): remove private from methods used in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Sep 24, 2016
1 parent 5bb37ee commit c5ad1d6
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions src/confirm.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,38 @@ export class Confirm implements OnDestroy, OnChanges, OnInit {
this.hidePopover();
}

/**
* @private
*/
@HostListener('document:click', ['$event.target'])
@HostListener('document:touchend', ['$event.target'])
onDocumentClick(target: HTMLElement): void {

if (this.popover && !this.elm.nativeElement.contains(target) && !this.popover.location.nativeElement.contains(target)) {
this.hidePopover();
}
}

/**
* @private
*/
@HostListener('click')
togglePopover(): void {
if (!this.popover) {
this.showPopover();
} else {
this.hidePopover();
}
}

/**
* @private
*/
@HostListener('window:resize')
onResize(): void {
this.positionPopover();
}

private showPopover(): void {
if (!this.popover && !this.isDisabled) {

Expand Down Expand Up @@ -292,27 +324,4 @@ export class Confirm implements OnDestroy, OnChanges, OnInit {
}
}

@HostListener('document:click', ['$event.target'])
@HostListener('document:touchend', ['$event.target'])
private onDocumentClick(target: HTMLElement): void {

if (this.popover && !this.elm.nativeElement.contains(target) && !this.popover.location.nativeElement.contains(target)) {
this.hidePopover();
}
}

@HostListener('click')
private togglePopover(): void {
if (!this.popover) {
this.showPopover();
} else {
this.hidePopover();
}
}

@HostListener('window:resize')
private onResize(): void {
this.positionPopover();
}

}

0 comments on commit c5ad1d6

Please sign in to comment.