Merge pull request #4669 from cmgustavo/bug/input-amount-lock-wp

Fix input-amount for WP. Read-only input (mobile)
This commit is contained in:
Gustavo Maximiliano Cortez 2016-08-09 20:33:19 -03:00 committed by GitHub
commit daf45d48a8
3 changed files with 51 additions and 28 deletions

View File

@ -420,12 +420,58 @@
</label>
<div class="input">
<div ng-if="index.isCordova">
<input type="amount" readonly="true" ng-show="!showAlternative" id="amount" ng-disabled="home.lockAmount" name="amount" ng-attr-placeholder="{{'Amount in'|translate}} {{home.unitName}}" ng-model="_amount" valid-amount required autocomplete="off" ng-focus="openInputAmountModal()" ignore-mouse-wheel>
<input type="amount" readonly="true" ng-show="showAlternative" id="alternative" ng-disabled="!home.isRateAvailable || home.lockAmount" name="alternative" ng-attr-placeholder="{{'Amount in'|translate}} {{ home.alternativeName }}" ng-model="_alternative" required autocomplete="off" ng-focus="openInputAmountModal()" ignore-mouse-wheel>
<input
type="number"
readonly="true"
ng-show="!showAlternative"
id="amount"
ng-disabled="home.lockAmount"
name="amount"
ng-attr-placeholder="{{'Amount in'|translate}} {{home.unitName}}"
ng-model="_amount"
valid-amount
required
autocomplete="off"
ng-click="openInputAmountModal()"
ignore-mouse-wheel>
<input
type="number"
readonly="true"
ng-show="showAlternative"
id="alternative"
ng-disabled="!home.isRateAvailable || home.lockAmount"
name="alternative"
ng-attr-placeholder="{{'Amount in'|translate}} {{ home.alternativeName }}"
ng-model="_alternative"
required
autocomplete="off"
ng-click="openInputAmountModal()"
ignore-mouse-wheel>
</div>
<div ng-if="!index.isCordova">
<input type="number" ng-show="!showAlternative" id="amount" ng-disabled="home.lockAmount" name="amount" ng-attr-placeholder="{{'Amount in'|translate}} {{home.unitName}}" ng-model="_amount" valid-amount required autocomplete="off" ignore-mouse-wheel>
<input type="number" ng-show="showAlternative" id="alternative" ng-disabled="!home.isRateAvailable || home.lockAmount" name="alternative" ng-attr-placeholder="{{'Amount in'|translate}} {{ home.alternativeName }}" ng-model="_alternative" required autocomplete="off" ignore-mouse-wheel>
<input
type="number"
ng-show="!showAlternative"
id="amount"
ng-disabled="home.lockAmount"
name="amount"
ng-attr-placeholder="{{'Amount in'|translate}} {{home.unitName}}"
ng-model="_amount"
valid-amount
required
autocomplete="off"
ignore-mouse-wheel>
<input
type="number"
ng-show="showAlternative"
id="alternative"
ng-disabled="!home.isRateAvailable || home.lockAmount"
name="alternative"
ng-attr-placeholder="{{'Amount in'|translate}} {{ home.alternativeName }}"
ng-model="_alternative"
required
autocomplete="off"
ignore-mouse-wheel>
</div>
<a class="postfix button" ng-show="!showAlternative" ng-style="{'background-color':index.backgroundColor}" ng-click="showAlternative = !showAlternative">{{home.unitName}}</a>
<a class="postfix button black" ng-show="showAlternative" ng-click="showAlternative = !showAlternative">{{home.alternativeIsoCode}}</a>

View File

@ -610,8 +610,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
form.amount.$setViewValue("" + amount);
form.amount.$isValid = true;
form.amount.$render();
if (!this.fromInputAmount)
this.lockAmount = true;
this.lockAmount = true;
this.fromInputAmount = false;
}

View File

@ -44,28 +44,6 @@ textarea:focus {
background: transparent;
}
input[type="amount"] {
&[readonly] {
width: 100%;
opacity: 1;
color: #B7C2CD;
margin-bottom: 1.5rem;
height: 35px;
background: transparent;
border: none;
padding-left: 0.1rem;
font-size: 13px;
border-bottom: 1px solid #E9EDF0;
cursor: text;
},
&[disabled] {
background-color: #E4E8EC;
color: #2C3E50;
padding-left: 0.5rem;
opacity: 1;
}
}
input[type="text"] {
&[disabled], &[readonly] {
background-color: #E4E8EC;