send form
This commit is contained in:
parent
22a533377b
commit
38495f11b7
2 changed files with 47 additions and 21 deletions
|
|
@ -3,7 +3,7 @@ var bitcore = require('bitcore');
|
||||||
var preconditions = require('preconditions').singleton();
|
var preconditions = require('preconditions').singleton();
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('SendController',
|
angular.module('copayApp.controllers').controller('SendController',
|
||||||
function($scope, $rootScope, $window, $timeout, $modal, $filter, notification, isMobile, rateService, txStatus) {
|
function($scope, $rootScope, $window, $timeout, $modal, $filter, notification, isMobile, rateService, txStatus, isCordova) {
|
||||||
|
|
||||||
var satToUnit;
|
var satToUnit;
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
}
|
}
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
}, 1);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setInputs = function() {
|
$scope.setInputs = function() {
|
||||||
|
|
@ -178,25 +178,35 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
var comment = form.comment.$modelValue;
|
$scope.creatingTX = true;
|
||||||
var merchantData = $scope._merchantData;
|
if ($scope.isWindowsPhoneApp)
|
||||||
var address, amount;
|
$rootScope.wpInputFocused = true;
|
||||||
if (!merchantData) {
|
|
||||||
address = form.address.$modelValue;
|
|
||||||
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
w.spend({
|
$timeout(function () {
|
||||||
merchantData: merchantData,
|
var comment = form.comment.$modelValue;
|
||||||
toAddress: address,
|
var merchantData = $scope._merchantData;
|
||||||
amountSat: amount,
|
var address, amount;
|
||||||
comment: comment,
|
if (!merchantData) {
|
||||||
}, function(err, txid, status) {
|
address = form.address.$modelValue;
|
||||||
$scope.loading = false;
|
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
|
||||||
if (err)
|
}
|
||||||
return $scope.setError(err);
|
|
||||||
txStatus.notify(status);
|
w.spend({
|
||||||
$scope.resetForm();
|
merchantData: merchantData,
|
||||||
|
toAddress: address,
|
||||||
|
amountSat: amount,
|
||||||
|
comment: comment,
|
||||||
|
}, function (err, txid, status) {
|
||||||
|
$scope.loading = false;
|
||||||
|
$scope.creatingTX = false;
|
||||||
|
if ($scope.isWindowsPhoneApp)
|
||||||
|
$rootScope.wpInputFocused = false;
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
return $scope.setError(err);
|
||||||
|
txStatus.notify(status);
|
||||||
|
$scope.resetForm();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,24 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row" ng-show="creatingTX">
|
||||||
|
<div class="large-12 columns">
|
||||||
|
<div class="panel">
|
||||||
|
<div class="box-notification">
|
||||||
|
<div class="box-icon secondary">
|
||||||
|
<i class="fi-bitcoin-circle icon-rotate spinner size-24"></i>
|
||||||
|
</div>
|
||||||
|
<span class="text-secondary size-14">
|
||||||
|
Creating Transaction...
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="!fetchingURL">
|
|
||||||
|
<div class="row" ng-show="!fetchingURL && !creatingTX">
|
||||||
<div class="large-8 large-centered columns">
|
<div class="large-8 large-centered columns">
|
||||||
<form name="sendForm" ng-submit="submitForm(sendForm)" novalidate>
|
<form name="sendForm" ng-submit="submitForm(sendForm)" novalidate>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue