payment intents style fixes
This commit is contained in:
parent
94d27b9ee4
commit
af6ee93ae5
6 changed files with 96 additions and 118 deletions
|
|
@ -2,50 +2,47 @@ var bitcore = require('bitcore');
|
|||
|
||||
angular.module('copayApp.controllers').controller('walletForPaymentController', function($rootScope, $scope, $modal, identityService, go) {
|
||||
|
||||
$scope.selectWallet = function(cb) {
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance, identityService) {
|
||||
$scope.loading = true;
|
||||
preconditions.checkState($rootScope.iden);
|
||||
// INIT: (not it a function, since there is no associated html)
|
||||
|
||||
var iden = $rootScope.iden;
|
||||
iden.on('newWallet', function() {
|
||||
$scope.setWallets();
|
||||
});
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance, identityService) {
|
||||
$scope.loading = true;
|
||||
preconditions.checkState($rootScope.iden);
|
||||
|
||||
$scope.setWallets = function() {
|
||||
$scope.wallets = $rootScope.iden.listWallets();
|
||||
};
|
||||
var iden = $rootScope.iden;
|
||||
iden.on('newWallet', function() {
|
||||
$scope.setWallets();
|
||||
});
|
||||
|
||||
$scope.ok = function(w) {
|
||||
$modalInstance.close();
|
||||
return cb(w);
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.close();
|
||||
return cb();
|
||||
};
|
||||
$scope.setWallets = function() {
|
||||
$scope.wallets = $rootScope.iden.listWallets();
|
||||
};
|
||||
|
||||
$modal.open({
|
||||
templateUrl: 'views/modals/walletSelection.html',
|
||||
windowClass: 'tiny',
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
$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: 'tiny',
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
||||
// INIT: (not it a function, since there is no associated html)
|
||||
if (!$rootScope.pendingPayment) {
|
||||
modalInstance.result.then(function(w) {
|
||||
if (w) {
|
||||
identityService.setFocusedWallet(w);
|
||||
$rootScope.walletForPaymentSet = true;
|
||||
} else {
|
||||
$rootScope.pendingPayment = null;
|
||||
}
|
||||
go.walletHome();
|
||||
} else {
|
||||
$scope.selectWallet(function(w) {
|
||||
if (w) {
|
||||
identityService.setFocusedWallet(w);
|
||||
go.send();
|
||||
} else {
|
||||
go.walletHome();
|
||||
}
|
||||
});
|
||||
};
|
||||
}, function() {
|
||||
$rootScope.pendingPayment = null;
|
||||
go.walletHome();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue