diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-10-06 12:44:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-06 12:44:50 +0200 |
commit | 8fecf8503aa1c9d6c0cec541149ba5da599869c2 (patch) | |
tree | 2fba1e667dfaab04c034b0612441df9896fba3c2 /settings | |
parent | f6e8da186d16dd2d9898f1ac2920622f3943cbb7 (diff) | |
parent | 4afb5d55279bb8d38a1193a1b81d52759ea6140e (diff) | |
download | nextcloud-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')
-rw-r--r-- | settings/css/settings.css | 4 | ||||
-rw-r--r-- | settings/js/personal.js | 20 | ||||
-rw-r--r-- | settings/templates/personal.php | 2 |
3 files changed, 22 insertions, 4 deletions
diff --git a/settings/css/settings.css b/settings/css/settings.css index d66b0f82b55..3cebcfb8d9c 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -96,6 +96,10 @@ input#identity { padding: 3px; } +.password-state { + display: inline-block; +} + table.nostyle label { margin-right: 2em; } table.nostyle td { padding: 0.2em 0; } 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); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index bbb47f48bab..b7bb0c8bfc7 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -129,7 +129,7 @@ if($_['passwordChangeSupported']) { placeholder="<?php echo $l->t('New password');?>" data-typetoggle="#personal-show" autocomplete="off" autocapitalize="off" autocorrect="off" /> - <input type="checkbox" id="personal-show" name="show" /><label for="personal-show"></label> + <input type="checkbox" id="personal-show" name="show" /><label for="personal-show" class="personal-show-label"></label> <input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" /> <br/> </form> |