mirror of https://github.com/BTCPrivate/copay.git
Adds loading indicator while getting buy/sell prices
This commit is contained in:
parent
6edbfad1ea
commit
7934eca099
|
@ -65,16 +65,19 @@
|
||||||
<a ng-show="showAlternative" class="postfix"
|
<a ng-show="showAlternative" class="postfix"
|
||||||
ng-click="showAlternative = false; fiat = null; buy.buyPrice = null">USD</a>
|
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
|
Buy
|
||||||
<span ng-show="qty">{{buy.buyPrice.currency}} {{buy.buyPrice.subtotal}} in Bitcoin</span>
|
<span ng-show="qty">{{buy.buyPrice.currency}} {{buy.buyPrice.subtotal}} in Bitcoin</span>
|
||||||
<span ng-show="fiat">{{buy.buyPrice.qty}} BTC</span>
|
<span ng-show="fiat">{{buy.buyPrice.qty}} BTC</span>
|
||||||
at {{buy.buyPrice.price}} {{buy.buyPrice.currency}}/BTC
|
at {{buy.buyPrice.price}} {{buy.buyPrice.currency}}/BTC
|
||||||
</div>
|
</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)
|
(Enter the amount to get the exchange rate)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center text-gray size-12 m20b" ng-show="buy.gettingBuyPrice">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
|
||||||
<input class="button black expand round"
|
<input class="button black expand round"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
ng-style="{'background-color':index.backgroundColor}"
|
||||||
|
|
|
@ -65,16 +65,21 @@
|
||||||
<a ng-show="showAlternative" class="postfix"
|
<a ng-show="showAlternative" class="postfix"
|
||||||
ng-click="showAlternative = false; fiat = null; sell.sellPrice = null">USD</a>
|
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
|
Sell
|
||||||
<span ng-show="qty"> {{sell.sellPrice.currency}} {{sell.sellPrice.subtotal}} in Bitcoin</span>
|
<span ng-show="qty"> {{sell.sellPrice.currency}} {{sell.sellPrice.subtotal}} in Bitcoin</span>
|
||||||
<span ng-show="fiat">{{sell.sellPrice.qty}} BTC</span>
|
<span ng-show="fiat">{{sell.sellPrice.qty}} BTC</span>
|
||||||
at {{sell.sellPrice.price}} {{sell.sellPrice.currency}}/BTC
|
at {{sell.sellPrice.price}} {{sell.sellPrice.currency}}/BTC
|
||||||
|
|
||||||
</div>
|
</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)
|
(Enter the amount to get the exchange rate)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center text-gray size-12 m20b" ng-show="sell.gettingSellPrice">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
|
||||||
<input class="button black expand round"
|
<input class="button black expand round"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
ng-style="{'background-color':index.backgroundColor}"
|
||||||
type="submit" value="{{'Continue'|translate}}"
|
type="submit" value="{{'Continue'|translate}}"
|
||||||
|
|
|
@ -15,7 +15,9 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
this.buyPrice = null;
|
this.buyPrice = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.gettingBuyPrice = true;
|
||||||
glideraService.buyPrice(token, price, function(err, buyPrice) {
|
glideraService.buyPrice(token, price, function(err, buyPrice) {
|
||||||
|
self.gettingBuyPrice = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = gettext('Could not get exchange information. Please, try again.');
|
self.error = gettext('Could not get exchange information. Please, try again.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,9 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
this.sellPrice = null;
|
this.sellPrice = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.gettingSellPrice = true;
|
||||||
glideraService.sellPrice(token, price, function(err, sellPrice) {
|
glideraService.sellPrice(token, price, function(err, sellPrice) {
|
||||||
|
self.gettingSellPrice = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = gettext('Could not get exchange information. Please, try again.');
|
self.error = gettext('Could not get exchange information. Please, try again.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue