From 619f3abc16c2afd470ca6c3a892be6b93bd38942 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 27 Dec 2013 14:14:21 -0500 Subject: [PATCH] Fix change password to not reload the user on every keystroke --- static/js/controllers.js | 7 ++++--- static/partials/user-admin.html | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/static/js/controllers.js b/static/js/controllers.js index c7403a7cd..146c93b69 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -625,6 +625,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use UserService.updateUserIn($scope, function(user) { $scope.askForPassword = user.askForPassword; + $scope.cuser = jQuery.extend({}, user); }); $scope.readyForPlan = function() { @@ -701,13 +702,13 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.updatingUser = true; $scope.changePasswordSuccess = false; - ApiService.changeUserDetails($scope.user).then(function() { + ApiService.changeUserDetails($scope.cuser).then(function() { $scope.updatingUser = false; $scope.changePasswordSuccess = true; // Reset the form - $scope.user.password = ''; - $scope.user.repeatPassword = ''; + $scope.cuser.password = ''; + $scope.cuser.repeatPassword = ''; $scope.changePasswordForm.$setPristine(); // Reload the user. diff --git a/static/partials/user-admin.html b/static/partials/user-admin.html index 1b05ac382..1e5f0ab82 100644 --- a/static/partials/user-admin.html +++ b/static/partials/user-admin.html @@ -60,9 +60,9 @@
- - + +