locale + darktheme support, fixes boolean profilefield

This commit is contained in:
_Bastler
2021-03-29 14:35:25 +02:00
parent 2cbfd628a2
commit f76843a2e9
11 changed files with 63 additions and 18 deletions
@@ -34,7 +34,8 @@
<input matInput type="email" [(ngModel)]="profileField.value" formControlName="value"
placeholder="{{'profileField.value' | i18n}}">
</mat-form-field>
<mat-slide-toggle *ngSwitchCase="'BOOL'" [(ngModel)]="profileField.value" formControlName="value">
<mat-slide-toggle *ngSwitchCase="'BOOL'" (change)="booleanChange(profileField)"
[checked]="profileField.value == 'true'">
{{'profileField.value' | i18n}}
</mat-slide-toggle>
<mat-form-field *ngSwitchCase="'NUMBER'">
@@ -17,7 +17,7 @@
<span *ngSwitchCase="'NUMBER'">{{profileField.value}}</span>
<button *ngSwitchCase="'BLOB'" mat-raised-button
(click)="openBlob(profileField)">{{'profileField.openBlob' | i18n}}</button>
<mat-slide-toggle *ngSwitchCase="'BOOL'" [(ngModel)]="profileField.value" disabled>
<mat-slide-toggle *ngSwitchCase="'BOOL'" [checked]="profileField.value == 'true'" disabled>
</mat-slide-toggle>
</div>
</td>
@@ -148,6 +148,16 @@ export class ProfileFieldDialog {
index: ['']
});
}
booleanChange(profileField) {
if(profileField.value == 'false') {
profileField.value = 'true';
} else {
profileField.value = 'false';
}
console.log(profileField);
}
}