Fixed: Fix multi modal opening
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
@@ -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,
