diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-27 18:10:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-27 18:10:26 +0100 |
commit | bf57d5eebf8b0fa2361b7973ce9772abd1bb4828 (patch) | |
tree | 6f8ba86f2bedf8bb630c5f0cef4fbce88c2abf76 /client/src/app/shared/forms | |
parent | 447fde277497dfff73310dc12bf79fb576139b94 (diff) | |
download | PeerTube-bf57d5eebf8b0fa2361b7973ce9772abd1bb4828.tar.gz PeerTube-bf57d5eebf8b0fa2361b7973ce9772abd1bb4828.tar.zst PeerTube-bf57d5eebf8b0fa2361b7973ce9772abd1bb4828.zip |
Client: try to improve ux for the upload form
Diffstat (limited to 'client/src/app/shared/forms')
-rw-r--r-- | client/src/app/shared/forms/form-reactive.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/forms/form-reactive.ts index 1e8a69771..a5732e083 100644 --- a/client/src/app/shared/forms/form-reactive.ts +++ b/client/src/app/shared/forms/form-reactive.ts | |||
@@ -21,4 +21,20 @@ export abstract class FormReactive { | |||
21 | } | 21 | } |
22 | } | 22 | } |
23 | } | 23 | } |
24 | |||
25 | // Same as onValueChanged but force checking even if the field is not dirty | ||
26 | protected forceCheck() { | ||
27 | for (const field in this.formErrors) { | ||
28 | // clear previous error message (if any) | ||
29 | this.formErrors[field] = ''; | ||
30 | const control = this.form.get(field); | ||
31 | |||
32 | if (control && !control.valid) { | ||
33 | const messages = this.validationMessages[field]; | ||
34 | for (const key in control.errors) { | ||
35 | this.formErrors[field] += messages[key] + ' '; | ||
36 | } | ||
37 | } | ||
38 | } | ||
39 | } | ||
24 | } | 40 | } |