create new address on send

This commit is contained in:
Matias Alejo Garcia 2015-06-27 13:48:25 -03:00
commit 063b520db0
3 changed files with 54 additions and 14 deletions

View file

@ -13,18 +13,32 @@
</nav>
<div class="modal-content">
<ul class="no-bullet">
<li class="panel" ng-repeat="w in wallets">
<a ng-click="payment.selectWallet(w.id)">
<div class="avatar-wallet"
ng-style="{'background-color':w.color}">{{(w.name || w.id) | limitTo: 1}}</div>
<div class="ellipsis">{{w.name || w.id}}</div>
<div class="size-12">{{w.m}} of {{w.n}}
<span ng-show="w.network=='testnet'">[Testnet]</span>
</div>
</a>
</li>
</ul>
<div class="onGoingProcess" ng-if="gettingAddress">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate> Getting address for wallet {{selectedWalletName}} ...</span>
</div>
</div>
<div ng-if="!gettingAddress">
<ul class="no-bullet">
<li class="panel" ng-repeat="w in wallets">
<a ng-click="selectWallet(w.id, w.name)">
<div class="avatar-wallet"
ng-style="{'background-color':w.color}">{{(w.name || w.id) | limitTo: 1}}</div>
<div class="ellipsis">{{w.name || w.id}}</div>
<div class="size-12">{{w.m}} of {{w.n}}
<span ng-show="w.network=='testnet'">[Testnet]</span>
</div>
</a>
</li>
</ul>
</div>
<div class="extra-margin-bottom"></div>
</div>

View file

@ -237,7 +237,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.copayers = walletStatus.wallet.copayers;
self.preferences = walletStatus.preferences;
self.setBalance(walletStatus.balance);
self.otherWallets = profileService.getWallets(self.network);
self.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) {
return w.id != self.walletId;
});;
$rootScope.$apply();
});
});

View file

@ -129,14 +129,32 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.openWalletsModal = function(wallets) {
var fc = profileService.focusedClient;
var ModalInstanceCtrl = function($scope, $modalInstance) {
$scope.wallets = wallets;
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
$scope.selectWallet = function(walletId, walletName) {
$scope.gettingAddress=true;
$scope.selectedWalletName=walletName;
$timeout(function(){
$scope.$apply();
});
addressService.getAddress(walletId,true, function(err,addr) {
$scope.gettingAddress=false;
if (!err || addr)
$modalInstance.close(addr);
else {
parseError(err);
self.error = err;
$modalInstance.dismiss('cancel');
}
});
};
};
var modalInstance = $modal.open({
templateUrl: 'views/modals/wallets.html',
windowClass: 'full animated slideInUp',
@ -147,6 +165,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
var m = angular.element(document.getElementsByClassName('reveal-modal'));
m.addClass('slideOutDown');
});
modalInstance.result.then(function(addr) {
if (addr) {
self.setForm(addr);
}
});
};
this.openTxpModal = function(tx, copayers) {