mirror of https://github.com/BTCPrivate/copay.git
prevents keyboard show on mobile (read-only input)
This commit is contained in:
parent
b3fcdf8584
commit
ba59a4f137
|
@ -404,7 +404,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-init="home.hideAlternative()">
|
<div class="row">
|
||||||
<div class="large-12 medium-12 columns">
|
<div class="large-12 medium-12 columns">
|
||||||
<div class="right" ng-hide="sendForm.amount.$pristine && !sendForm.amount.$modelValue ">
|
<div class="right" ng-hide="sendForm.amount.$pristine && !sendForm.amount.$modelValue ">
|
||||||
<span class="has-error right size-12" ng-show="sendForm.amount.$invalid">
|
<span class="has-error right size-12" ng-show="sendForm.amount.$invalid">
|
||||||
|
@ -420,8 +420,8 @@
|
||||||
<span translate>Amount</span><span ng-show="showAlternative"> [{{home.alternativeIsoCode}}]</span>
|
<span translate>Amount</span><span ng-show="showAlternative"> [{{home.alternativeIsoCode}}]</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<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" ng-focus="openInputAmountModal()" ignore-mouse-wheel>
|
<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="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" 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>
|
||||||
<a class="postfix button" ng-show="!showAlternative" ng-style="{'background-color':index.backgroundColor}" ng-click="showAlternative = !showAlternative">{{home.unitName}}</a>
|
<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>
|
<a class="postfix button black" ng-show="showAlternative" ng-click="showAlternative = !showAlternative">{{home.alternativeIsoCode}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
ret.countDown = null;
|
ret.countDown = null;
|
||||||
ret.sendMaxInfo = {};
|
ret.sendMaxInfo = {};
|
||||||
ret.showAlternative = false;
|
ret.showAlternative = false;
|
||||||
|
ret.fromInputAmount = null;
|
||||||
var vanillaScope = ret;
|
var vanillaScope = ret;
|
||||||
|
|
||||||
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
||||||
|
@ -286,7 +287,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
$scope.__alternative = newValue;
|
$scope.__alternative = newValue;
|
||||||
if (typeof(newValue) === 'number' && self.isRateAvailable) {
|
if (self.isRateAvailable) {
|
||||||
$scope._amount = parseFloat((rateService.fromFiat(newValue, self.alternativeIsoCode) * satToUnit).toFixed(self.unitDecimals), 10);
|
$scope._amount = parseFloat((rateService.fromFiat(newValue, self.alternativeIsoCode) * satToUnit).toFixed(self.unitDecimals), 10);
|
||||||
} else {
|
} else {
|
||||||
$scope.__amount = null;
|
$scope.__amount = null;
|
||||||
|
@ -302,7 +303,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
$scope.__amount = newValue;
|
$scope.__amount = newValue;
|
||||||
if (typeof(newValue) === 'number' && self.isRateAvailable) {
|
if (self.isRateAvailable) {
|
||||||
$scope.__alternative = parseFloat((rateService.toFiat(newValue * self.unitToSatoshi, self.alternativeIsoCode)).toFixed(2), 10);
|
$scope.__alternative = parseFloat((rateService.toFiat(newValue * self.unitToSatoshi, self.alternativeIsoCode)).toFixed(2), 10);
|
||||||
} else {
|
} else {
|
||||||
$scope.__alternative = null;
|
$scope.__alternative = null;
|
||||||
|
@ -355,6 +356,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
} else {
|
} else {
|
||||||
amountResult = amount;
|
amountResult = amount;
|
||||||
}
|
}
|
||||||
|
self.fromInputAmount = true;
|
||||||
self.setForm(null, amountResult, null);
|
self.setForm(null, amountResult, null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -569,7 +571,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
form.amount.$setViewValue("" + amount);
|
form.amount.$setViewValue("" + amount);
|
||||||
form.amount.$isValid = true;
|
form.amount.$isValid = true;
|
||||||
form.amount.$render();
|
form.amount.$render();
|
||||||
this.lockAmount = true;
|
if (!this.fromInputAmount)
|
||||||
|
this.lockAmount = true;
|
||||||
|
this.fromInputAmount = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comment) {
|
if (comment) {
|
||||||
|
|
|
@ -44,6 +44,28 @@ textarea:focus {
|
||||||
background: transparent;
|
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"] {
|
input[type="text"] {
|
||||||
&[disabled], &[readonly] {
|
&[disabled], &[readonly] {
|
||||||
background-color: #E4E8EC;
|
background-color: #E4E8EC;
|
||||||
|
|
Loading…
Reference in New Issue