mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 02:27:06 +01:00
Implement warning on close unsaved view
This commit is contained in:
parent
1b55717cc7
commit
7efdce44f7
6 changed files with 90 additions and 3 deletions
|
|
@ -13,6 +13,9 @@ export class ConfirmDialogComponent {
|
|||
@Output()
|
||||
public confirmClicked = new EventEmitter()
|
||||
|
||||
@Output()
|
||||
public alternativeClicked = new EventEmitter()
|
||||
|
||||
@Input()
|
||||
title = $localize`Confirmation`
|
||||
|
||||
|
|
@ -28,14 +31,22 @@ export class ConfirmDialogComponent {
|
|||
@Input()
|
||||
btnCaption = $localize`Confirm`
|
||||
|
||||
@Input()
|
||||
alternativeBtnClass = 'btn-secondary'
|
||||
|
||||
@Input()
|
||||
alternativeBtnCaption
|
||||
|
||||
@Input()
|
||||
buttonsEnabled = true
|
||||
|
||||
confirmButtonEnabled = true
|
||||
alternativeButtonEnabled = true
|
||||
seconds = 0
|
||||
secondsTotal = 0
|
||||
|
||||
confirmSubject: Subject<boolean>
|
||||
alternativeSubject: Subject<boolean>
|
||||
|
||||
delayConfirm(seconds: number) {
|
||||
const refreshInterval = 0.15 // s
|
||||
|
|
@ -68,4 +79,10 @@ export class ConfirmDialogComponent {
|
|||
this.confirmSubject?.next(true)
|
||||
this.confirmSubject?.complete()
|
||||
}
|
||||
|
||||
alternative() {
|
||||
this.alternativeClicked.emit()
|
||||
this.alternativeSubject?.next(true)
|
||||
this.alternativeSubject?.complete()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue