Fix request user select
parent
5d69a04379
commit
c1e666ebbc
|
@ -10,6 +10,7 @@
|
|||
[compareWith]="equals"
|
||||
(change)="toggleUser(decoPreview, decoDescription)"
|
||||
required>
|
||||
<option [ngValue]="{_id: '0'}">Auswählen...</option>
|
||||
<option *ngFor="let user of users" [ngValue]="user">
|
||||
{{user.username}}
|
||||
</option>
|
||||
|
|
|
@ -19,7 +19,7 @@ export class RequestAwardComponent {
|
|||
|
||||
showSuccessLabel = false;
|
||||
|
||||
user: User = {};
|
||||
user: User = {_id: '0'};
|
||||
|
||||
decoration: Decoration = null;
|
||||
|
||||
|
@ -49,6 +49,7 @@ export class RequestAwardComponent {
|
|||
}
|
||||
|
||||
toggleUser(previewImage, decoDescription) {
|
||||
if (this.user._id != '0') {
|
||||
this.decoration = null;
|
||||
if (previewImage && decoDescription) {
|
||||
previewImage.src = decoDescription.innerHTML = '';
|
||||
|
@ -62,6 +63,9 @@ export class RequestAwardComponent {
|
|||
});
|
||||
|
||||
this.showForm = true;
|
||||
} else {
|
||||
this.showForm = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
[compareWith]="equals"
|
||||
required
|
||||
(change)="toggleUser()">
|
||||
<option [ngValue]="{_id: '0'}">Auswählen...</option>
|
||||
<option *ngFor="let user of users" [ngValue]="user">
|
||||
{{user.username}}
|
||||
</option>
|
||||
|
|
|
@ -19,7 +19,7 @@ export class RequestPromotionComponent {
|
|||
|
||||
showSuccessLabel = false;
|
||||
|
||||
user: User = {};
|
||||
user: User = {_id: '0'};
|
||||
|
||||
newLevel: number;
|
||||
|
||||
|
@ -52,8 +52,12 @@ export class RequestPromotionComponent {
|
|||
}
|
||||
|
||||
toggleUser() {
|
||||
if (this.user._id != '0') {
|
||||
this.showForm = true;
|
||||
this.newLevel = this.user.rank.level;
|
||||
} else {
|
||||
this.showForm = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue