Browse Source

minor fix

pull/146/head
Mohammed Tantawy 7 years ago
parent
commit
4cc59c4d12
2 changed files with 6 additions and 3 deletions
  1. +4
    -2
      src/assets/scripts/profile/profile.controller.js
  2. +2
    -1
      src/assets/scripts/profile/profile.html

+ 4
- 2
src/assets/scripts/profile/profile.controller.js View File

@ -33,6 +33,7 @@ const ProfileController = ($scope, $timeout, ProfileService, UserService) => {
return;
}
$scope.processing = "Sending the data..."
ProfileService.updateUserProfile($scope.user.id, $scope.userUpdated)
.then((result)=>{
@ -44,10 +45,11 @@ const ProfileController = ($scope, $timeout, ProfileService, UserService) => {
$scope.messages = 'Oops, we received your request, but there was an error processing it.';
})
.finally(() => {
// Hide status messages after three seconds.
$scope.processing = null;
// Hide status messages after five seconds.
$timeout(() => {
$scope.messages = null;
}, 3000);
}, 5000);
});
}


+ 2
- 1
src/assets/scripts/profile/profile.html View File

@ -30,6 +30,7 @@
<div class="card-body-profile">
<div class="profile-forms">
<div id="messages" class="alert alert-success" data-ng-show="messages" data-ng-bind="messages"></div>
<div id="processing" class="alert alert-info" data-ng-show="processing" data-ng-bind="processing"></div>
<h5 class="card-title d-flex text-black-bold"> Your Profile</h5>
<form name="ProfileForm" role="form" novalidate>
<div class="row ">
@ -417,7 +418,7 @@
<div class="row ">
<div class="col-6 profile-form-row">
<button type="submit" data-ng-click="updateProfile(ProfileForm)" class="btn btn-gradient">UPDATE</button>
<button type="submit" data-ng-disabled="processing" data-ng-click="updateProfile(ProfileForm)" class="btn btn-gradient">UPDATE</button>
<button type="reset" class="btn btn-border">CLEAR</button>
</div>
<div class="col-6 profile-form-row">


Loading…
Cancel
Save