add loading to submit button
This commit is contained in:
parent
ca3d298617
commit
70bd476fa8
4 changed files with 12 additions and 3 deletions
|
|
@ -40,12 +40,14 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
|
|||
preconditions.checkArgument(pin);
|
||||
preconditions.checkState($rootScope.iden);
|
||||
preconditions.checkState(_credentials && _credentials.email);
|
||||
$scope.loading = true;
|
||||
|
||||
pinService.save(pin, _credentials.email, _credentials.password, function(err) {
|
||||
_credentials.password = '';
|
||||
_credentials = null;
|
||||
$scope.askForPin = 0;
|
||||
$rootScope.hasPin = true;
|
||||
$scope.loading = null;
|
||||
$scope.createDefaultWallet();
|
||||
});
|
||||
};
|
||||
|
|
@ -106,7 +108,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
|
|||
$scope.loading = true;
|
||||
|
||||
identityService.create(emailOrUsername, password, function(err) {
|
||||
$scope.loading = false;
|
||||
$scope.loading = null;
|
||||
$scope.error = null;
|
||||
if (err) {
|
||||
var msg = err.toString();
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
|||
$scope.error = 'Please enter the required fields';
|
||||
return;
|
||||
}
|
||||
$scope.loading = true;
|
||||
$rootScope.starting = true;
|
||||
|
||||
var credentials = pinService.get(pin, function(err, credentials) {
|
||||
|
|
@ -93,12 +94,14 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
|||
preconditions.checkArgument(pin);
|
||||
preconditions.checkState($rootScope.iden);
|
||||
preconditions.checkState(_credentials && _credentials.email);
|
||||
$scope.loading = true;
|
||||
|
||||
pinService.save(pin, _credentials.email, _credentials.password, function(err) {
|
||||
_credentials.password = '';
|
||||
_credentials = null;
|
||||
$scope.askForPin = 0;
|
||||
$rootScope.hasPin = true;
|
||||
$scope.loading = null;
|
||||
$scope.openWallets();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -230,7 +230,9 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="large-6 medium-6 small-6 columns text-right">
|
||||
<button translate type="submit" class="button primary radius expand m0" ng-disabled="setPinForm.$invalid || error">
|
||||
<button translate type="submit" class="button primary radius expand m0"
|
||||
ng-disabled="setPinForm.$invalid || error || loading">
|
||||
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
|
||||
OK
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,9 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="large-6 medium-6 small-6 columns text-right">
|
||||
<button translate type="submit" class="button primary radius expand m0" ng-disabled="setPinForm.$invalid || error">
|
||||
<button translate type="submit" class="button primary radius expand m0"
|
||||
ng-disabled="setPinForm.$invalid || error || loading">
|
||||
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
|
||||
OK
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue