Merge pull request #2115 from cmgustavo/bug/mobile-20

Bug/mobile 20
This commit is contained in:
Matias Alejo Garcia 2014-12-11 21:31:07 -03:00
commit 8d2f24ceb5
5 changed files with 74 additions and 56 deletions

View file

@ -6,69 +6,66 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
var w = $rootScope.wallet;
if (w.isShared())
$scope.copayers = w.getRegisteredPeerIds();
};
};
$scope.sign = function(ntxid) {
var w = $rootScope.wallet;
$scope.loading = true;
$scope.error = $scope.success = null;
w.signAndSend(ntxid, function(err, id, status) {
$scope.loading = false;
if (err)
$scope.error = err;
else
txStatus.notify(status);
});
};
$scope.reject = function(ntxid) {
var w = $rootScope.wallet;
w.reject(ntxid, function(err, status) {
if (err)
$scope.error = err;
else
txStatus.notify(status);
});
};
$scope.broadcast = function(ntxid) {
var w = $rootScope.wallet;
$scope.error = $scope.success = null;
$scope.loading = true;
w.issueTx(ntxid, function(err, txid, status) {
$scope.loading = false;
if (err)
$scope.error = err;
txStatus.notify(status);
});
};
var $outScope = $scope;
$scope.openTxModal = function(tx) {
var ModalInstanceCtrl = function($scope, $modalInstance) {
var w = $rootScope.wallet;
$scope.tx = tx;
$scope.loading = null;
$scope.sign = function(ntxid) {
$outScope.sign(ntxid);
$modalInstance.dismiss('cancel');
$scope.loading = true;
$timeout(function() {
w.signAndSend(ntxid, function(err, id, status) {
$scope.loading = false;
if (err)
$scope.error = err;
else
$modalInstance.close(status);
});
}, 100);
};
$scope.reject = function(ntxid) {
$outScope.reject(ntxid);
$modalInstance.dismiss('cancel');
$scope.loading = true;
$timeout(function() {
w.reject(ntxid, function(err, status) {
$scope.loading = false;
if (err)
$scope.error = err;
else
$modalInstance.close(status);
});
}, 100);
};
$scope.broadcast = function(ntxid) {
$scope.loading = true;
$timeout(function() {
w.issueTx(ntxid, function(err, txid, status) {
$scope.loading = false;
if (err)
$scope.error = err;
$modalInstance.close(status);
});
}, 100);
};
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
};
$modal.open({
var modalInstance = $modal.open({
templateUrl: 'views/modals/txp-details.html',
windowClass: 'medium',
controller: ModalInstanceCtrl,
});
modalInstance.result.then(function(status) {
txStatus.notify(status);
});
};
});

View file

@ -6,9 +6,7 @@ angular.module('copayApp.controllers').controller('IndexController', function($s
};
$scope.swipe = function(invert) {
if (isCordova) {
go.swipe(invert);
}
go.swipe(invert);
};
});