Removes the check mark after 5 second timeout.

This commit is contained in:
Raghu Nayyar 2016-09-01 11:43:34 +02:00
parent 91ffb63595
commit 16711a2f99
1 changed files with 12 additions and 0 deletions

View File

@ -197,6 +197,15 @@ $(document).ready(function () {
if($('#pass2').length) { if($('#pass2').length) {
$('#pass2').showPassword().keyup(); $('#pass2').showPassword().keyup();
} }
var removeloader = function () {
setTimeout(function(){
if ($('.password-state').length > 0) {
$('.password-state').remove();
}
}, 5000)
};
$("#passwordbutton").click(function () { $("#passwordbutton").click(function () {
OC.msg.startSaving('#password-error-msg'); OC.msg.startSaving('#password-error-msg');
var isIE8or9 = $('html').hasClass('lte9'); var isIE8or9 = $('html').hasClass('lte9');
@ -211,10 +220,13 @@ $(document).ready(function () {
$('#passwordchanged').hide(); $('#passwordchanged').hide();
$('#passworderror').hide(); $('#passworderror').hide();
$("#passwordbutton").attr('disabled', 'disabled'); $("#passwordbutton").attr('disabled', 'disabled');
$("#passwordbutton").after("<span class='password-loading icon icon-loading-small-dark password-state'></span>");
// Ajax foo // Ajax foo
$.post(OC.generateUrl('/settings/personal/changepassword'), post, function (data) { $.post(OC.generateUrl('/settings/personal/changepassword'), post, function (data) {
if (data.status === "success") { if (data.status === "success") {
$(".password-loading").remove();
$("#passwordbutton").after("<span class='checkmark icon icon-checkmark password-state'></span>"); $("#passwordbutton").after("<span class='checkmark icon icon-checkmark password-state'></span>");
removeloader();
$('#pass1').val(''); $('#pass1').val('');
$('#pass2').val('').change(); $('#pass2').val('').change();
OC.msg.finishedSaving('#password-error-msg', data); OC.msg.finishedSaving('#password-error-msg', data);