svn commit: r1867577 - /ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1867577 - /ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js

jleroux@apache.org
Author: jleroux
Date: Thu Sep 26 14:41:50 2019
New Revision: 1867577

URL: http://svn.apache.org/viewvc?rev=1867577&view=rev
Log:
Fixed: Fix multi modal opening
(OFBIZ-11211)

The issue is that when closing the modal the div inside html dom is not removed.
Then opening a second time create another identical div. Since a lookup is based
on an unique id, this id is no more unique...

Thanks: Carl Demus

Modified:
    ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js?rev=1867577&r1=1867576&r2=1867577&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js Thu Sep 26 14:41:50 2019
@@ -119,12 +119,14 @@ function bindObservers(bind_element) {
     });
     jQuery(bind_element).on("click", "[data-dialog-url]", function(){
         var element = jQuery(this);
+        var id = element.attr("id");
         var url = element.data("dialog-url");
         var title = element.data("dialog-title");
         var width = element.data("dialog-width");
         var height = element.data("dialog-height");
         var params = element.data("dialog-params");
-        var dialogContainer = jQuery('<div/>');
+        var dialogContainer = jQuery('<div id="container_'+ id + '"/>');
+
         dialogContainer.dialog({
             autoOpen: false,
             title: title,
@@ -132,6 +134,9 @@ function bindObservers(bind_element) {
             width: width,
             modal: true,
             closeOnEscape: true,
+            close: function() {
+                document.getElementById("container_" + id).parentElement.remove();
+            },
             open: function() {
                 jQuery.ajax({
                     url: url,