LSform: add CSS class on submitting form to permit visual adaptation

This commit is contained in:
Benjamin Renard 2020-06-11 20:35:55 +02:00
parent 6e02cbe2d5
commit a5814afefc
2 changed files with 8 additions and 0 deletions

View file

@ -66,6 +66,10 @@ div.LSform_layout_current {
display: block;
}
form.submitting div.LSform_layout_current, form.submitting ul.LSform_layout_active {
opacity: 0.4;
}
/*
* Architecture
*/

View file

@ -297,6 +297,8 @@ var LSform = new Class({
return;
}
this.submitting = true;
console.log(this.LSform);
this.LSform.addClass('submitting');
// Fire
LSdebug('onSubmit(): fire submit event');
@ -306,6 +308,7 @@ var LSform = new Class({
onSubmitConfirm: function (confirmed, event) {
if (!confirmed) {
this.submitting = false;
this.LSform.removeClass('submitting');
return;
}
@ -348,6 +351,7 @@ var LSform = new Class({
onAjaxSubmitComplete: function(responseText, responseXML) {
this.submitting = false;
this.LSform.removeClass('submitting');
var data = JSON.decode(responseText);
if ( varLSdefault.checkAjaxReturn(data) ) {
this.resetErrors();