Skip to content

Commit

Permalink
fix - btn success
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineKM committed Jan 15, 2021
1 parent d67e40d commit 666d807
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ const init = () => {
initNavbarResponsive();
initModal();
initLocalization();
initForm('.form-contact', (response) => {
if (response.success) window.location.href = './';
});
initForm('.form-contact');
initForm('.form-forgot');
initForm('.form-recovery', (response) => {
if (response.success) window.location.href = './';
});
initForm('.form-recovery');
initForm('.form-login', (response) => {
if (response.success) loginSuccessHandler();
if (response.errors) loginErrorHandler('.form-login', response.errors);
Expand Down Expand Up @@ -158,10 +154,8 @@ const initForm = (formClass, successHandler = () => { }) => {
successHandler(response);
if (response.success) {
if (!$('.btn[type="submit"]').hasClass('btn-success')) {
$('.btn[type="submit"]').toggleClass('btn-success');
setTimeout(() => {
$('.btn[type="submit"]').toggleClass('btn-success');
}, 2000)
$('.btn[type="submit"]').toggleClass('btn-success').css('cursor', 'not-allowed');

}
} else {
if (!$('.btn[type="submit"]').hasClass('btn-error')) {
Expand Down

0 comments on commit 666d807

Please sign in to comment.