Fix loading state and error message display
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
494dea2c60
commit
6347fe86c9
|
@ -393,9 +393,6 @@ form .warning input[type='checkbox']+label {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-shadow: 0 0 2px rgba(0, 0, 0, .4); // better readability on bright background
|
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,
|
||||||
.lost-password-container #lost-password-back {
|
.lost-password-container #lost-password-back {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*/
|
*/
|
||||||
OC.Login = _.extend(OC.Login || {}, {
|
OC.Login = _.extend(OC.Login || {}, {
|
||||||
onLogin: function () {
|
onLogin: function () {
|
||||||
$('#submit-icon')
|
$('#submit-wrapper .submit-icon')
|
||||||
.removeClass('icon-confirm-white')
|
.removeClass('icon-confirm-white')
|
||||||
.addClass('icon-loading-small');
|
.addClass('icon-loading-small');
|
||||||
$('#submit')
|
$('#submit')
|
||||||
|
|
|
@ -16,6 +16,11 @@ OC.Lostpassword = {
|
||||||
$('#lost-password').click(OC.Lostpassword.resetLink);
|
$('#lost-password').click(OC.Lostpassword.resetLink);
|
||||||
$('#reset-password-submit').click(OC.Lostpassword.resetPassword);
|
$('#reset-password-submit').click(OC.Lostpassword.resetPassword);
|
||||||
$('#lost-password-back').click(OC.Lostpassword.backToLogin);
|
$('#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){
|
backToLogin : function(event){
|
||||||
|
@ -41,7 +46,8 @@ OC.Lostpassword = {
|
||||||
$('#reset-password-wrapper').slideDown().fadeIn();
|
$('#reset-password-wrapper').slideDown().fadeIn();
|
||||||
$('#user').focus();
|
$('#user').focus();
|
||||||
|
|
||||||
if (!$('#user').val().length){
|
// Generate a browser warning if field empty
|
||||||
|
if ($('#user').val().length === 0) {
|
||||||
$('#submit').trigger('click');
|
$('#submit').trigger('click');
|
||||||
} else {
|
} else {
|
||||||
if (OC.config.lost_password_link === 'disabled') {
|
if (OC.config.lost_password_link === 'disabled') {
|
||||||
|
@ -49,6 +55,7 @@ OC.Lostpassword = {
|
||||||
} else if (OC.config.lost_password_link) {
|
} else if (OC.config.lost_password_link) {
|
||||||
window.location = OC.config.lost_password_link;
|
window.location = OC.config.lost_password_link;
|
||||||
} else {
|
} else {
|
||||||
|
OC.Lostpassword.onSendLink();
|
||||||
$.post(
|
$.post(
|
||||||
OC.generateUrl('/lostpassword/email'),
|
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){
|
sendLinkDone : function(result){
|
||||||
var sendErrorMsg;
|
var sendErrorMsg;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue