1
0
mirror of https://github.com/bitwarden/desktop synced 2025-12-26 05:03:13 +00:00

fix: radio instead of dropdown

This commit is contained in:
knhash
2021-06-15 12:30:31 +05:30
parent 3b4142bd0d
commit d8a542d1cc
2 changed files with 16 additions and 7 deletions

View File

@@ -27,13 +27,17 @@
</button>
</div>
<div class="box-content condensed" [hidden]="!showOptions">
<div class="box-content-row" appBoxRow>
<label for="type" class="sr-only">{{'type' | i18n}}</label>
<select id="type" [(ngModel)]="options.type" (change)="saveOptions()">
<option value="password">{{'password' | i18n}}</option>
<option value="passphrase">{{'passphrase' | i18n}}</option>
</select>
</div>
<div class="box-content-row box-content-row-radio">
<div class="radio-group text-default" appBoxRow name="PassTypeOptions"
*ngFor="let o of passTypeOptions">
<label for="type" class="sr-only">{{'type' | i18n}}</label>
<input type="radio" class="radio" [(ngModel)]="options.type" name="Type_{{o.value}}"
id="type_{{o.value}}" [value]="o.value" (change)="saveOptions()"
[checked]="options.type === o.value">
<label class="unstyled" for="type_{{o.value}}">
{{o.name | i18n}}
</label>
</div>
</div>
</div>
<div class="box" [hidden]="!showOptions" *ngIf="options.type === 'passphrase'">

View File

@@ -13,8 +13,13 @@ import {
templateUrl: 'password-generator.component.html',
})
export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {
passTypeOptions: any[];
constructor(passwordGenerationService: PasswordGenerationService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService) {
super(passwordGenerationService, platformUtilsService, i18nService, window);
this.passTypeOptions = [
{ name: 'password', value: 'password' },
{ name: 'passphrase', value: 'passphrase' }
]
}
}