[Library]: Modal: Add stayOpen boolean if on ok clicked must not close the modal
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57705 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
8ab8cc7829
commit
af9b7ac0ea
|
@ -112,20 +112,30 @@ export class AlertModal {
|
|||
@Input()
|
||||
public okDisabled: boolean = false;
|
||||
|
||||
/**
|
||||
* If the value is true, a checkbox option will be appeared on the right side of footer
|
||||
*/
|
||||
@Input()
|
||||
public choice: boolean = false;
|
||||
|
||||
/**
|
||||
* if the value is true then on ok clicked, modal will stay open.
|
||||
*/
|
||||
public stayOpen: boolean = false;
|
||||
|
||||
/**
|
||||
* Value will be emitted if @choice is true
|
||||
*/
|
||||
public select: boolean = false;
|
||||
/**
|
||||
* Emitted when a ok button was clicked
|
||||
* or when Ok method is called.
|
||||
*/
|
||||
@Output() public alertOutput: EventEmitter<any> = new EventEmitter();
|
||||
@Output() public clickOutsideOutput: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
@ViewChild('element') element: ElementRef;
|
||||
|
||||
constructor(public _elementRef: ElementRef) {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +149,9 @@ export class AlertModal {
|
|||
* ok method closes the modal and emits modalOutput.
|
||||
*/
|
||||
ok() {
|
||||
this.cancel();
|
||||
if (!this.stayOpen){
|
||||
this.cancel();
|
||||
}
|
||||
if (!this.choice) {
|
||||
this.alertOutput.emit(true);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue