fix seed source selector

This commit is contained in:
Gabriel Bazán 2017-05-29 15:04:22 -03:00
commit b8a09a0154
4 changed files with 51 additions and 49 deletions

View file

@ -58,19 +58,19 @@
Wallet Key
</div>
<select class="m10t"
ng-model="seedSource"
ng-model="formData.seedSource"
ng-options="seed as seed.label for seed in seedOptions"
ng-change="resizeView()">
</select>
</label>
<label class="item item-input item-stacked-label"
ng-show="seedSource.id == 'trezor' || seedSource.id == 'ledger'">
ng-show="formData.seedSource.id == 'trezor' || formData.seedSource.id == 'ledger'">
<span class="input-label" translate>Account Number</span>
<input type="number" id="account" ng-model="formData.account" ignore-mouse-wheel>
</label>
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
<label class="item item-input item-stacked-label" ng-show="formData.seedSource.id == 'set'">
<span class="input-label" translate>Wallet Recovery Phrase</span>
<input id="ext-master"
placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
@ -80,16 +80,16 @@
ng-model="formData.privateKey">
</label>
<ion-toggle class="has-comment" ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()" ng-show="seedSource.id == 'new' || seedSource.id == 'set'">
<ion-toggle class="has-comment" ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()" ng-show="formData.seedSource.id == 'new' || formData.seedSource.id == 'set'">
<span class="toggle-label" translate>Add a password</span>
</ion-toggle>
<div class="comment">
<span ng-show="seedSource.id == 'new'" translate>Add an optional password to secure the recovery phrase</span>
<span ng-show="seedSource.id == 'set'" translate>The recovery phrase could require a password to be imported</span>
<span ng-show="formData.seedSource.id == 'new'" translate>Add an optional password to secure the recovery phrase</span>
<span ng-show="formData.seedSource.id == 'set'" translate>The recovery phrase could require a password to be imported</span>
</div>
<div class="item item-input" ng-show="encrypt">
<input ng-show="seedSource.id == 'new'"
<input ng-show="formData.seedSource.id == 'new'"
placeholder="{{'Password'|translate}}"
type="password"
autocapitalize="off"
@ -98,7 +98,7 @@
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
<input ng-show="seedSource.id == 'set'"
<input ng-show="formData.seedSource.id == 'set'"
placeholder="{{'Password'|translate}}"
type="password"
autocapitalize="off"
@ -109,7 +109,7 @@
</div>
<div class="item item-input" ng-show="encrypt">
<input ng-show="seedSource.id == 'new'"
<input ng-show="formData.seedSource.id == 'new'"
placeholder="{{'Repeat password'|translate}}"
type="password"
autocapitalize="off"
@ -117,7 +117,7 @@
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
<input ng-show="seedSource.id == 'set'"
<input ng-show="formData.seedSource.id == 'set'"
placeholder="{{'Repeat password'|translate}}"
type="password"
autocapitalize="off"
@ -126,7 +126,7 @@
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
</div>
<div class="text-center box-notification error" ng-show="(seedSource.id =='new' || seedSource.id =='set') && encrypt">
<div class="text-center box-notification error" ng-show="(formData.seedSource.id =='new' || formData.seedSource.id =='set') && encrypt">
<strong translate>This password cannot be recovered. If the password is lost, there is no way you could recover your funds.</strong>
</div>
@ -134,7 +134,7 @@
<span class="toggle-label" translate>I have written it down</span>
</ion-checkbox>
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
<label class="item item-input item-stacked-label" ng-show="formData.seedSource.id == 'set'">
<span class="input-label" translate>Derivation Path</span>
<input type="text"
placeholder="{{'BIP32 path for address derivation'|translate}}"
@ -146,7 +146,7 @@
</div> <!-- list -->
<button type="submit" class="button button-standard button-primary"
ng-disabled="setupForm.$invalid || ((encrypt && !formData.passwordSaved) || encrypt && ((seedSource.id == 'new' && !formData.createPassphrase) || (seedSource.id == 'set' && !formData.passphrase)))"
ng-disabled="setupForm.$invalid || ((encrypt && !formData.passwordSaved) || encrypt && ((formData.seedSource.id == 'new' && !formData.createPassphrase) || (formData.seedSource.id == 'set' && !formData.passphrase)))"
translate>Join
</button>
</form>