From 53d2129bd1243de2de699485552538e1d8f5f34e Mon Sep 17 00:00:00 2001 From: acognet Date: Thu, 16 Jun 2022 17:58:19 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B05129=20-=20Unwanted=20popup=20during=20a?= =?UTF-8?q?=20transition=20with=20an=20AttributeExternalField?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/wizardhelper.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/wizardhelper.js b/js/wizardhelper.js index b7ca604dc..261cb4c31 100644 --- a/js/wizardhelper.js +++ b/js/wizardhelper.js @@ -151,6 +151,9 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) var sString = "$('#"+aRefreshed[i]+"').trigger('change').trigger('update');"; window.setTimeout(sString, 1); // Synchronous 'trigger' does nothing, call it asynchronously } + if($('.blockUI').length == 0) { + $('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading'); + } }; this.UpdateWizard = function () @@ -179,6 +182,10 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) function(html){ $('#ajax_content').html(html); $('.blockUI').parent().unblock(); + + if($('.blockUI').length == 0) { + $('.disabledDuringFieldLoading').prop("disabled", false).removeClass('disabledDuringFieldLoading'); + } //console.log('data received:', oWizardHelper); //oWizardHelper.FromJSON(json_data); //oWizardHelper.UpdateFields(); // Is done directly in the html provided by ajax.render.php @@ -215,6 +222,7 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) index = 0; this.ResetQuery(); this.UpdateWizard(); + var fieldForm=null; while(index < aFieldNames.length ) { sAttCode = aFieldNames[index]; @@ -225,10 +233,14 @@ function WizardHelper(sClass, sFormPrefix, sState, sInitialState, sStimulus) message: '', overlayCSS: {backgroundColor: '#f1f1f1', opacity: 0.3} }); + fieldForm=$('#field_' + sFieldId).closest('form'); this.RequestAllowedValues(sAttCode); } index++; } + if(fieldForm!=null){ + fieldForm.find('button[type=submit]:not(:disabled)').prop("disabled", true).addClass('disabledDuringFieldLoading'); + } this.AjaxQueryServer(); };