Fix loading state and error message display

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-11-05 05:45:32 +01:00
parent 494dea2c60
commit 6347fe86c9
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
3 changed files with 18 additions and 5 deletions

View File

@ -393,9 +393,6 @@ form .warning input[type='checkbox']+label {
width: 100%;
text-shadow: 0 0 2px rgba(0, 0, 0, .4); // better readability on bright background
}
.lost-password-container {
margin: 0;
}
.lost-password-container #lost-password,
.lost-password-container #lost-password-back {
display: inline-block;

View File

@ -12,7 +12,7 @@
*/
OC.Login = _.extend(OC.Login || {}, {
onLogin: function () {
$('#submit-icon')
$('#submit-wrapper .submit-icon')
.removeClass('icon-confirm-white')
.addClass('icon-loading-small');
$('#submit')

View File

@ -16,6 +16,11 @@ OC.Lostpassword = {
$('#lost-password').click(OC.Lostpassword.resetLink);
$('#reset-password-submit').click(OC.Lostpassword.resetPassword);
$('#lost-password-back').click(OC.Lostpassword.backToLogin);
$('#reset-password-wrapper .submit-icon')
.addClass('icon-confirm-white')
.removeClass('icon-loading-small');
$('#reset-password-submit')
.attr('value', t('core', 'Reset password'));
},
backToLogin : function(event){
@ -41,7 +46,8 @@ OC.Lostpassword = {
$('#reset-password-wrapper').slideDown().fadeIn();
$('#user').focus();
if (!$('#user').val().length){
// Generate a browser warning if field empty
if ($('#user').val().length === 0) {
$('#submit').trigger('click');
} else {
if (OC.config.lost_password_link === 'disabled') {
@ -49,6 +55,7 @@ OC.Lostpassword = {
} else if (OC.config.lost_password_link) {
window.location = OC.config.lost_password_link;
} else {
OC.Lostpassword.onSendLink();
$.post(
OC.generateUrl('/lostpassword/email'),
{
@ -62,6 +69,15 @@ OC.Lostpassword = {
}
},
onSendLink: function () {
$('.submit-icon')
.removeClass('icon-confirm-white')
.addClass('icon-loading-small');
$('#reset-password-submit')
.attr('value', t('core', 'Sending email …'));
return true;
},
sendLinkDone : function(result){
var sendErrorMsg;