mirror of https://github.com/BTCPrivate/copay.git
commit
8d2f24ceb5
|
@ -22,6 +22,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
ng-controller="IndexController"
|
ng-controller="IndexController"
|
||||||
|
ng-swipe-disable-mouse
|
||||||
ng-swipe-left="swipe()"
|
ng-swipe-left="swipe()"
|
||||||
ng-swipe-right="swipe(true)">
|
ng-swipe-right="swipe(true)">
|
||||||
|
|
||||||
|
|
|
@ -8,67 +8,64 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
|
||||||
$scope.copayers = w.getRegisteredPeerIds();
|
$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) {
|
$scope.openTxModal = function(tx) {
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
|
var w = $rootScope.wallet;
|
||||||
$scope.tx = tx;
|
$scope.tx = tx;
|
||||||
|
$scope.loading = null;
|
||||||
|
|
||||||
$scope.sign = function(ntxid) {
|
$scope.sign = function(ntxid) {
|
||||||
$outScope.sign(ntxid);
|
$scope.loading = true;
|
||||||
$modalInstance.dismiss('cancel');
|
$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) {
|
$scope.reject = function(ntxid) {
|
||||||
$outScope.reject(ntxid);
|
$scope.loading = true;
|
||||||
$modalInstance.dismiss('cancel');
|
$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() {
|
$scope.cancel = function() {
|
||||||
$modalInstance.dismiss('cancel');
|
$modalInstance.dismiss('cancel');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
$modal.open({
|
var modalInstance = $modal.open({
|
||||||
templateUrl: 'views/modals/txp-details.html',
|
templateUrl: 'views/modals/txp-details.html',
|
||||||
windowClass: 'medium',
|
windowClass: 'medium',
|
||||||
controller: ModalInstanceCtrl,
|
controller: ModalInstanceCtrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modalInstance.result.then(function(status) {
|
||||||
|
txStatus.notify(status);
|
||||||
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,9 +6,7 @@ angular.module('copayApp.controllers').controller('IndexController', function($s
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.swipe = function(invert) {
|
$scope.swipe = function(invert) {
|
||||||
if (isCordova) {
|
|
||||||
go.swipe(invert);
|
go.swipe(invert);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
|
|
||||||
<div class="m20tp">
|
<div class="m20tp">
|
||||||
<div class="text-center size-72 m10v">
|
<div class="text-center size-72 m10v">
|
||||||
<div class="text-primary">
|
<div ng-show="statusStr !== 'Transaction was rejected'" class="text-primary">
|
||||||
<i class="fi-check"></i>
|
<i class="fi-check"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div ng-show="statusStr === 'Transaction was rejected'" class="text-warning">
|
||||||
|
<i class="fi-x"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,16 +58,35 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row collapse" ng-show="!tx.signedBy[$root.wallet.getMyCopayerId()] && !tx.rejectedBy[$root.wallet.getMyCopayerId()]">
|
<div class="box-notification" ng-show="error">
|
||||||
|
<div class="box-icon error">
|
||||||
|
<i class="fi-x size-24"></i>
|
||||||
|
</div>
|
||||||
|
<span class="text-warning size-14">
|
||||||
|
{{error}}
|
||||||
|
</span>
|
||||||
|
<a class="close-notification text-warning" ng-click="error=null">×</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row collapse"
|
||||||
|
ng-init="hideSign = false; hideReject = false"
|
||||||
|
ng-show="!tx.signedBy[$root.wallet.getMyCopayerId()] && !tx.rejectedBy[$root.wallet.getMyCopayerId()]">
|
||||||
<div class="large-6 medium-6 small-6 columns">
|
<div class="large-6 medium-6 small-6 columns">
|
||||||
<button class="button warning m0" ng-click="reject(tx.ntxid)" ng-disabled="loading">
|
<button class="button warning m0" ng-click="hideSign = true; reject(tx.ntxid);"
|
||||||
<i class="fi-x icon-sign x"></i> <span translate>Reject</span>
|
ng-disabled="loading" ng-show="!hideReject">
|
||||||
|
<i class="fi-x icon-sign x" ng-show="!loading"></i>
|
||||||
|
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
|
||||||
|
<span translate>Reject</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-6 medium-6 small-6 columns text-right">
|
<div class="large-6 medium-6 small-6 columns text-right">
|
||||||
<button class="button primary m0" ng-click="sign(tx.ntxid)" ng-disabled="loading">
|
<button class="button primary m0" ng-click="hideReject = true; sign(tx.ntxid)"
|
||||||
<i class="fi-check icon-sign check"></i> <span translate>Sign</span>
|
ng-disabled="loading" ng-show="!hideSign">
|
||||||
|
<i class="fi-check icon-sign check" ng-show="!loading"></i>
|
||||||
|
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
|
||||||
|
<span translate>Sign</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue