- var width = parseInt($(popup).attr("popup_width") || "800");
- var height = parseInt($(popup).attr("popup_height") || "600");
- var autoOpen = parseInt($(popup).attr("popup_autoOpen") || "0");
+ // more than one widget on a page are possible
+ popup_window.each(function(i) {
+ var that = $(this);
+
+ // all atributes are strings, convert them to integers here
+ var width = parseInt(that.attr("popup_width") || "800");
+ var height = parseInt(that.attr("popup_height") || "600");
+ var autoOpen = parseInt(that.attr("popup_autoOpen") || "0");
+ var modal = parseInt(that.attr("popup_modal") || "0");
+
+ debug("Popup parameters: width: " + width + ", height: " + height + ", autoOpen: " + autoOpen);
+ that.dialog({
+ closeOnEscape: true,
+ autoOpen: autoOpen,
+ height: height,
+ width: width,
+ modal: modal ? true : false,
+ resizable: true,
+ buttons: {
+ Cancel: function() {
+ that.dialog("close");
+ }
+ },
+ close: function() {}
+ });