This is an automated email from the ASF dual-hosted git repository. jamesyong pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push: new 798822c Fixed: wait spinner doesn't show when running ajaxUpdateArea (OFBIZ-12094) 798822c is described below commit 798822c94fc2910e09944321868563b167772291 Author: James Yong <jamesy...@apache.org> AuthorDate: Sat Dec 19 09:19:34 2020 +0800 Fixed: wait spinner doesn't show when running ajaxUpdateArea (OFBIZ-12094) Use setTimeout() after running waitSpinnerShow() to ensure wait spinner icon is displayed properly. --- .../webapp/common/js/util/OfbizUtil.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/themes/common-theme/webapp/common/js/util/OfbizUtil.js b/themes/common-theme/webapp/common/js/util/OfbizUtil.js index 4bda2cc..559bd96 100644 --- a/themes/common-theme/webapp/common/js/util/OfbizUtil.js +++ b/themes/common-theme/webapp/common/js/util/OfbizUtil.js @@ -620,16 +620,18 @@ function ajaxUpdateArea(areaId, target, targetParams) { return; } waitSpinnerShow(); - jQuery.ajax({ - url: target, - type: "POST", - data: targetParams, - success: function(data) { - jQuery("#" + areaId).html(data); - waitSpinnerHide(); - }, - error: function(data) {waitSpinnerHide()} - }); + setTimeout(function() { + jQuery.ajax({ + url: target, + type: "POST", + data: targetParams, + success: function(data) { + jQuery("#" + areaId).html(data); + waitSpinnerHide(); + }, + error: function(data) {waitSpinnerHide()} + }); + }, 0); } /** Update multiple areas (HTML container elements).