aboutsummaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-06 12:44:50 +0200
committerGitHub <noreply@github.com>2016-10-06 12:44:50 +0200
commit8fecf8503aa1c9d6c0cec541149ba5da599869c2 (patch)
tree2fba1e667dfaab04c034b0612441df9896fba3c2 /settings/js
parentf6e8da186d16dd2d9898f1ac2920622f3943cbb7 (diff)
parent4afb5d55279bb8d38a1193a1b81d52759ea6140e (diff)
downloadnextcloud-server-8fecf8503aa1c9d6c0cec541149ba5da599869c2.tar.gz
nextcloud-server-8fecf8503aa1c9d6c0cec541149ba5da599869c2.zip
Merge pull request #1229 from nextcloud/bugfix/change-password-changes
Bugfix/change password changes
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/personal.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index e0c99ae774d..3290074a84c 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -197,8 +197,16 @@ $(document).ready(function () {
if($('#pass2').length) {
$('#pass2').showPassword().keyup();
}
+
+ var removeloader = function () {
+ setTimeout(function(){
+ if ($('.password-state').length > 0) {
+ $('.password-state').remove();
+ }
+ }, 5000)
+ };
+
$("#passwordbutton").click(function () {
- OC.msg.startSaving('#password-error-msg');
var isIE8or9 = $('html').hasClass('lte9');
// FIXME - TODO - once support for IE8 and IE9 is dropped
// for IE8 and IE9 this will check additionally if the typed in password
@@ -210,12 +218,17 @@ $(document).ready(function () {
var post = $("#passwordform").serialize();
$('#passwordchanged').hide();
$('#passworderror').hide();
+ $("#passwordbutton").attr('disabled', 'disabled');
+ $("#passwordbutton").after("<span class='password-loading icon icon-loading-small-dark password-state'></span>");
+ $(".personal-show-label").hide();
// Ajax foo
$.post(OC.generateUrl('/settings/personal/changepassword'), post, function (data) {
if (data.status === "success") {
+ $("#passwordbutton").after("<span class='checkmark icon icon-checkmark password-state'></span>");
+ removeloader();
+ $(".personal-show-label").show();
$('#pass1').val('');
$('#pass2').val('').change();
- OC.msg.finishedSaving('#password-error-msg', data);
} else {
if (typeof(data.data) !== "undefined") {
OC.msg.finishedSaving('#password-error-msg', data);
@@ -230,6 +243,8 @@ $(document).ready(function () {
);
}
}
+ $(".password-loading").remove();
+ $("#passwordbutton").removeAttr('disabled');
});
return false;
} else {
@@ -243,7 +258,6 @@ $(document).ready(function () {
);
return false;
}
-
});
$('#displayName').keyUpDelayedOrEnter(changeDisplayName);