diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-25 10:28:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-25 10:28:43 +0200 |
commit | 772d5642ba617865519ca5e590061adf174866d4 (patch) | |
tree | 27e2f3c9a78a4de67128f005d2bd73a5eecca804 /client/src/app/shared/forms/form-reactive.ts | |
parent | d73c98884ec7f970ed95a01fb2d445d10c53c817 (diff) | |
download | PeerTube-772d5642ba617865519ca5e590061adf174866d4.tar.gz PeerTube-772d5642ba617865519ca5e590061adf174866d4.tar.zst PeerTube-772d5642ba617865519ca5e590061adf174866d4.zip |
Improve captions UX (at least I've tried)
Diffstat (limited to 'client/src/app/shared/forms/form-reactive.ts')
-rw-r--r-- | client/src/app/shared/forms/form-reactive.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/forms/form-reactive.ts index 441ec8203..e4f7481b5 100644 --- a/client/src/app/shared/forms/form-reactive.ts +++ b/client/src/app/shared/forms/form-reactive.ts | |||
@@ -10,6 +10,7 @@ export type FormReactiveValidationMessages = { | |||
10 | 10 | ||
11 | export abstract class FormReactive { | 11 | export abstract class FormReactive { |
12 | protected abstract formValidatorService: FormValidatorService | 12 | protected abstract formValidatorService: FormValidatorService |
13 | protected formChanged = false | ||
13 | 14 | ||
14 | form: FormGroup | 15 | form: FormGroup |
15 | formErrors: FormReactiveErrors | 16 | formErrors: FormReactiveErrors |
@@ -31,6 +32,8 @@ export abstract class FormReactive { | |||
31 | this.formErrors[ field ] = '' | 32 | this.formErrors[ field ] = '' |
32 | const control = this.form.get(field) | 33 | const control = this.form.get(field) |
33 | 34 | ||
35 | if (control.dirty) this.formChanged = true | ||
36 | |||
34 | // Don't care if dirty on force check | 37 | // Don't care if dirty on force check |
35 | const isDirty = control.dirty || forceCheck === true | 38 | const isDirty = control.dirty || forceCheck === true |
36 | if (control && isDirty && !control.valid) { | 39 | if (control && isDirty && !control.valid) { |