Skip to content

Commit

Permalink
fix(watch): Only 1 click is required to select brand/model & error ar…
Browse files Browse the repository at this point in the history
…e correctly displayed

Contributes to #93 and #87
  • Loading branch information
MathieuNls committed Jan 6, 2017
1 parent b9b376f commit 155ce89
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/pages/watch/watch.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
[formGroup]="watchForm"
(ngSubmit)="onSubmit()"
>
<!--
<pre>{{watchForm.value | json}}</pre>
<pre>{{watchModel | json}}</pre> -->



<mobile-error [errors] = "errors"></mobile-error>

Expand All @@ -18,7 +17,6 @@
[control] = "watchForm.controls['brand']"
[errorLabel] = "'brand-required'"
[submitAttempt] = "submitAttempt"
[autoComplete] = false
[model] = true
[(value)] = "watchModel.brand"
(valueChange) = filterBrand($event)
Expand All @@ -37,6 +35,7 @@
<mobile-input
[id] = "'name'"
[label] = "'model'"
[errorLabel] = "'model-required'"
[control] = "watchForm.controls['name']"
[submitAttempt] = "submitAttempt"
[model] = true
Expand Down Expand Up @@ -84,19 +83,19 @@

<div [hidden]="watchModel.id!==null">
<button
[disabled]="submitAttempt"
[disabled]="watchForm.valid && submitAttempt && error == false"
ion-button
color="primary" type="submit">
<span [hidden]="submitAttempt">{{ 'add-watch' | translate }}</span>
<ion-spinner [hidden]="!submitAttempt"></ion-spinner>
<span [hidden]="submitAttempt && watchForm.valid && error == false">{{ 'add-watch' | translate }}</span>
<ion-spinner [hidden]="!submitAttempt || !watchForm.valid || error"></ion-spinner>
</button>
</div>

<div [hidden]="watchModel.id===null">
<button [disabled]="submitAttempt" ion-button color="accent" type="submit"
<button [disabled]="submitAttempt && watchForm.valid" ion-button color="accent" type="submit"
>
<span [hidden]="submitAttempt">{{ 'update-watch' | translate }}</span>
<ion-spinner [hidden]="!submitAttempt"></ion-spinner>
<ion-spinner [hidden]="!submitAttempt && watchForm.valid"></ion-spinner>
</button>

<button [disabled]="submitAttempt" ion-button color="danger"
Expand Down

0 comments on commit 155ce89

Please sign in to comment.