Hide AdvOpts after click on SendAll

This commit is contained in:
Gustavo Maximiliano Cortez 2015-11-23 10:47:24 -03:00
commit cfcda94052
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 10 additions and 4 deletions

View file

@ -278,7 +278,7 @@
<a class="right lh"
ng-if="index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount"
ng-click="home.sendAll(index.availableMaxBalance, index.feeToSendMaxStr, index.feeRateToSendMax)"
ng-click="home.sendAll(index.availableMaxBalance, index.feeToSendMaxStr, index.feeRateToSendMax, index.currentFeeLevel)"
translate> Send All
</a>
@ -383,7 +383,7 @@
</div>
</div>
<div class="m20b" ng-init="home.hideAdvSend=true">
<div class="m20b" ng-init="home.hideAdvSend=true" ng-show="!home.disableAdvSend">
<a class="button outline light-gray expand tiny m0" ng-click="home.hideAdvSend=!home.hideAdvSend">
<i class="fi-widget m3r"></i>
<span translate ng-hide="!home.hideAdvSend">Show advanced options</span>

View file

@ -23,6 +23,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.isMobile = isMobile.any();
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
this.blockUx = false;
this.disableAdvSend = false;
this.isRateAvailable = false;
this.showScanner = false;
this.isMobile = isMobile.any();
@ -1022,6 +1023,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.lockAmount = false;
this.currentSendFeeLevel = null;
this.hideAdvSend = true;
this.disableAdvSend = false;
$scope.currentSpendUnconfirmed = configService.getSync().wallet.spendUnconfirmed;
this._amount = this._address = null;
@ -1285,15 +1287,19 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.setForm(null, amount, null, feeRate);
};
this.sendAll = function(amount, feeStr, feeRate) {
this.sendAll = function(amount, feeStr, feeRate, currentFeeLevel) {
var self = this;
var msg = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees", {
fee: feeStr
});
confirmDialog.show(msg, function(confirmed) {
if (confirmed)
if (confirmed) {
self._doSendAll(amount, feeRate);
self.disableAdvSend = true;
self.currentSendFeeLevel = currentFeeLevel;
$scope.currentSpendUnconfirmed = configService.getSync().wallet.spendUnconfirmed;
}
});
};