Skip to content

Commit

Permalink
feat(material-timepicker): add possibility to disable or enable closi…
Browse files Browse the repository at this point in the history
…ng popup with ESCAPE button
  • Loading branch information
Agranom committed Mar 27, 2018
1 parent 839e8a5 commit b2a34bf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class NgxMaterialTimepickerComponent implements OnInit {

@Input() cancelBtnTmpl: TemplateRef<Node>;
@Input() confirmBtnTmpl: TemplateRef<Node>;
@Input('ESC') isEsc = true;
@Output() timeSet = new EventEmitter<string>();

@ViewChild('timepicker') timepicker: ElementRef;
Expand All @@ -67,7 +68,7 @@ export class NgxMaterialTimepickerComponent implements OnInit {
private eventService: NgxMaterialTimepickerEventService) {

merge(this.eventService.backdropClick,
this.eventService.keydownEvent.pipe(filter(e => e.keyCode === ESCAPE)))
this.eventService.keydownEvent.pipe(filter(e => e.keyCode === ESCAPE && this.isEsc)))
.subscribe(() => this.close());

}
Expand Down

0 comments on commit b2a34bf

Please sign in to comment.