N°5729 - Fix disabled button in bulk update/transition when picking a value in a drop-down list

This commit is contained in:
Stephen Abello
2023-02-22 15:42:20 +01:00
parent 6d019615d0
commit cac7e94a67

View File

@@ -151,7 +151,7 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus)
var sString = "$('#"+aRefreshed[i]+"').trigger('change').trigger('update');"; var sString = "$('#"+aRefreshed[i]+"').trigger('change').trigger('update');";
window.setTimeout(sString, 1); // Synchronous 'trigger' does nothing, call it asynchronously window.setTimeout(sString, 1); // Synchronous 'trigger' does nothing, call it asynchronously
} }
if($('.blockUI').length == 0) { if($('[data-field-status="blocked"]').length === 0) {
$('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading'); $('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading');
} }
}; };
@@ -181,9 +181,11 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus)
{ operation: 'wizard_helper', json_obj: this.ToJSON() }, { operation: 'wizard_helper', json_obj: this.ToJSON() },
function(html){ function(html){
$('#ajax_content').html(html); $('#ajax_content').html(html);
$('.blockUI').parent().unblock(); $('[data-field-status="blocked"]')
.attr('data-field-status', 'ready')
.unblock();
if($('.blockUI').length == 0) { if($('[data-field-status="blocked"]').length === 0) {
$('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading'); $('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading');
} }
//console.log('data received:', oWizardHelper); //console.log('data received:', oWizardHelper);
@@ -229,16 +231,18 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus)
sFieldId = this.GetFieldId(sAttCode); sFieldId = this.GetFieldId(sAttCode);
if (sFieldId !== undefined) { if (sFieldId !== undefined) {
$('#fstatus_' + sFieldId).html('<img src="../images/indicator.gif" />'); $('#fstatus_' + sFieldId).html('<img src="../images/indicator.gif" />');
$('#field_' + sFieldId).find('div').block({ $('#field_' + sFieldId).find('div')
message: '', .attr('data-field-status', 'blocked')
overlayCSS: {backgroundColor: '#f1f1f1', opacity: 0.3} .block({
message: '',
overlayCSS: {backgroundColor: '#f1f1f1', opacity: 0.3}
}); });
fieldForm = $('#field_' + sFieldId).closest('form'); fieldForm = $('#field_' + sFieldId).closest('form');
this.RequestAllowedValues(sAttCode); this.RequestAllowedValues(sAttCode);
} }
index++; index++;
} }
if ((fieldForm !== null) && ($('.blockUI').length > 0)) { if ((fieldForm !== null) && ($('[data-field-status="blocked"]').length > 0)) {
fieldForm.find('button[type=submit]:not(:disabled)').prop("disabled", true).addClass('disabledDuringFieldLoading'); fieldForm.find('button[type=submit]:not(:disabled)').prop("disabled", true).addClass('disabledDuringFieldLoading');
} }
this.AjaxQueryServer(); this.AjaxQueryServer();