bwc
This commit is contained in:
parent
04fb7ba032
commit
320de62f13
348 changed files with 7745 additions and 30874 deletions
47
src/js/controllers/walletForPayment.js
Normal file
47
src/js/controllers/walletForPayment.js
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('walletForPaymentController', function($rootScope, $scope, $modal, identityService, go) {
|
||||
|
||||
// INIT: (not it a function, since there is no associated html)
|
||||
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance, identityService) {
|
||||
$scope.loading = true;
|
||||
preconditions.checkState($rootScope.iden);
|
||||
|
||||
var iden = $rootScope.iden;
|
||||
iden.on('newWallet', function() {
|
||||
$scope.setWallets();
|
||||
});
|
||||
|
||||
$scope.setWallets = function() {
|
||||
$scope.wallets = $rootScope.iden.getWallets();
|
||||
};
|
||||
|
||||
$scope.ok = function(w) {
|
||||
$modalInstance.close(w);
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
$rootScope.pendingPayment = null;
|
||||
$modalInstance.close();
|
||||
};
|
||||
};
|
||||
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'views/modals/walletSelection.html',
|
||||
windowClass: 'full',
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
||||
modalInstance.result.then(function(w) {
|
||||
if (w) {
|
||||
identityService.setFocusedWallet(w);
|
||||
$rootScope.walletForPaymentSet = true;
|
||||
} else {
|
||||
$rootScope.pendingPayment = null;
|
||||
}
|
||||
go.walletHome();
|
||||
}, function() {
|
||||
$rootScope.pendingPayment = null;
|
||||
go.walletHome();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue