Adds loading indicator while getting buy/sell prices

This commit is contained in:
Gustavo Maximiliano Cortez 2015-09-09 15:24:47 -03:00
parent 6edbfad1ea
commit 7934eca099
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
4 changed files with 16 additions and 4 deletions

View File

@ -65,16 +65,19 @@
<a ng-show="showAlternative" class="postfix"
ng-click="showAlternative = false; fiat = null; buy.buyPrice = null">USD</a>
<div class="text-center text-gray size-12 m20b" ng-show="buy.buyPrice.qty">
<div class="text-center text-gray size-12 m20b" ng-show="!buy.gettingBuyPrice && buy.buyPrice.qty">
Buy
<span ng-show="qty">{{buy.buyPrice.currency}} {{buy.buyPrice.subtotal}} in Bitcoin</span>
<span ng-show="fiat">{{buy.buyPrice.qty}} BTC</span>
at {{buy.buyPrice.price}} {{buy.buyPrice.currency}}/BTC
</div>
<div class="text-center text-gray size-12 m20b" ng-show="!buy.buyPrice.qty" translate>
<div class="text-center text-gray size-12 m20b" ng-show="!buy.gettingBuyPrice && !buy.buyPrice.qty" translate>
(Enter the amount to get the exchange rate)
</div>
<div class="text-center text-gray size-12 m20b" ng-show="buy.gettingBuyPrice">
...
</div>
<input class="button black expand round"
ng-style="{'background-color':index.backgroundColor}"

View File

@ -65,16 +65,21 @@
<a ng-show="showAlternative" class="postfix"
ng-click="showAlternative = false; fiat = null; sell.sellPrice = null">USD</a>
<div class="text-center text-gray size-12 m20b" ng-show="sell.sellPrice.qty">
<div class="text-center text-gray size-12 m20b" ng-show="!sell.gettingSellPrice && sell.sellPrice.qty">
Sell
<span ng-show="qty"> {{sell.sellPrice.currency}} {{sell.sellPrice.subtotal}} in Bitcoin</span>
<span ng-show="fiat">{{sell.sellPrice.qty}} BTC</span>
at {{sell.sellPrice.price}} {{sell.sellPrice.currency}}/BTC
</div>
<div class="text-center text-gray size-12 m20b" ng-show="!sell.sellPrice.qty" translate>
<div class="text-center text-gray size-12 m20b" ng-show="!sell.gettingSellPrice && !sell.sellPrice.qty" translate>
(Enter the amount to get the exchange rate)
</div>
<div class="text-center text-gray size-12 m20b" ng-show="sell.gettingSellPrice">
...
</div>
<input class="button black expand round"
ng-style="{'background-color':index.backgroundColor}"
type="submit" value="{{'Continue'|translate}}"

View File

@ -15,7 +15,9 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
this.buyPrice = null;
return;
}
this.gettingBuyPrice = true;
glideraService.buyPrice(token, price, function(err, buyPrice) {
self.gettingBuyPrice = false;
if (err) {
self.error = gettext('Could not get exchange information. Please, try again.');
}

View File

@ -19,7 +19,9 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
this.sellPrice = null;
return;
}
this.gettingSellPrice = true;
glideraService.sellPrice(token, price, function(err, sellPrice) {
self.gettingSellPrice = false;
if (err) {
self.error = gettext('Could not get exchange information. Please, try again.');
}