Cancel/clear form when using payment protocol
This commit is contained in:
parent
445a4e3ca9
commit
cfb7383b2d
2 changed files with 16 additions and 1 deletions
|
|
@ -492,6 +492,16 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.cancelSend = function(form) {
|
||||||
|
delete $rootScope.merchant;
|
||||||
|
$rootScope.merchantError = false;
|
||||||
|
form.address.$setViewValue('');
|
||||||
|
form.address.$render();
|
||||||
|
form.amount.$setViewValue('');
|
||||||
|
form.comment.$setViewValue('');
|
||||||
|
form.$setPristine();
|
||||||
|
};
|
||||||
|
|
||||||
$scope.onChanged = function() {
|
$scope.onChanged = function() {
|
||||||
var value = $scope.address || '';
|
var value = $scope.address || '';
|
||||||
var uri;
|
var uri;
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-12 columns text-right">
|
<div class="large-6 medium-6 small-6 columns text-left">
|
||||||
|
<a ng-click="cancelSend(sendForm)" class="button warning m0" ng-show="!!$root.merchant">
|
||||||
|
Cancel
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="large-6 medium-6 small-6 columns text-right">
|
||||||
<button type="submit" class="button primary m0" ng-disabled="sendForm.$invalid || loading">
|
<button type="submit" class="button primary m0" ng-disabled="sendForm.$invalid || loading">
|
||||||
Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue