diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 7c8bc9f1b..b985a6634 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -404,7 +404,7 @@ -
+
@@ -420,8 +420,8 @@ Amount [{{home.alternativeIsoCode}}] diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index e6ca47f91..c178d472e 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi ret.countDown = null; ret.sendMaxInfo = {}; ret.showAlternative = false; + ret.fromInputAmount = null; var vanillaScope = ret; var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) { @@ -286,7 +287,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi }, set: function(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); } else { $scope.__amount = null; @@ -302,7 +303,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi }, set: function(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); } else { $scope.__alternative = null; @@ -355,6 +356,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi } else { amountResult = amount; } + self.fromInputAmount = true; self.setForm(null, amountResult, null); }; @@ -569,7 +571,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi form.amount.$setViewValue("" + amount); form.amount.$isValid = true; form.amount.$render(); - this.lockAmount = true; + if (!this.fromInputAmount) + this.lockAmount = true; + this.fromInputAmount = false; } if (comment) { diff --git a/src/sass/forms.scss b/src/sass/forms.scss index e5bbebbbe..e58f64586 100644 --- a/src/sass/forms.scss +++ b/src/sass/forms.scss @@ -44,6 +44,28 @@ 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;