payment intents style fixes

This commit is contained in:
Matias Alejo Garcia 2014-12-10 20:30:36 -03:00
commit af6ee93ae5
6 changed files with 96 additions and 118 deletions

View file

@ -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();
});
});