forked from primefaces/primeng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request primefaces#525 from atretyak1985/issue_#NNTR-558
[NNTR-558]Added functionality - closes the modal window after navigating to ano…
- Loading branch information
Showing
19 changed files
with
314 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
import { Component, Input, Output, EventEmitter } from '@angular/core'; | ||
import { Component, Input, Output, EventEmitter, AfterViewInit, OnDestroy } from '@angular/core'; | ||
import { CommonHelpers } from 'common/helpers'; | ||
|
||
|
||
@Component({ | ||
selector: 'confirm-dialog', | ||
templateUrl: 'confirm_dialog.component.html' | ||
}) | ||
|
||
export class ConfirmDialogComponent { | ||
export class ConfirmDialogComponent implements AfterViewInit, OnDestroy { | ||
private static dialogSelector: string = '#confirm-dialog'; | ||
@Input() isAdmin: boolean = false; | ||
@Input() headerText: string = 'Dialog'; | ||
@Input() bodyText: string = 'Are you sure you want to do this?'; | ||
@Output() onConfirm = new EventEmitter(); | ||
|
||
ngAfterViewInit() { | ||
CommonHelpers.dialogBackHandler(ConfirmDialogComponent.dialogSelector); | ||
} | ||
|
||
ngOnDestroy() { | ||
jQuery(ConfirmDialogComponent.dialogSelector).off(); | ||
jQuery(window).off('popstate'); | ||
} | ||
|
||
show() { | ||
jQuery('#confirm-dialog').modal('show'); | ||
jQuery(ConfirmDialogComponent.dialogSelector).modal('show'); | ||
} | ||
|
||
hide() { | ||
jQuery('#confirm-dialog').modal('hide'); | ||
jQuery(ConfirmDialogComponent.dialogSelector).modal('hide'); | ||
} | ||
|
||
clickConfirm() { | ||
this.onConfirm.emit(); | ||
this.onConfirm.emit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.