From: Wolfram Schneider Date: Thu, 10 Jul 2014 09:11:28 +0000 (+0000) Subject: support multiple popup windows X-Git-Tag: 1.0.0~389^2~8 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=63cd167da7164a9954a77498db2cced959e5fdb4 support multiple popup windows --- diff --git a/src/mkws-popup.js b/src/mkws-popup.js index 153425b..f5b0550 100644 --- a/src/mkws-popup.js +++ b/src/mkws-popup.js @@ -23,22 +23,25 @@ $(document).ready(function () { debug("found popup windows: " + popup.length); } - var width = parseInt($(popup).attr("popup_width") || "800"); - var height = parseInt($(popup).attr("popup_height") || "600"); - var autoOpen = parseInt($(popup).attr("popup_autoOpen") || "0"); + $(popup).each(function (i) { + var width = parseInt(this.attr("popup_width") || "800"); + var height = parseInt(this.attr("popup_height") || "600"); + var autoOpen = parseInt(this.attr("popup_autoOpen") || "0"); - $(popup).dialog({ - closeOnEscape: true, - autoOpen: autoOpen, - height: height, - width: width, - modal: true, - resizable: true, - buttons: { - Cancel: function () { - $(popup).dialog("close"); - } - }, - close: function () {} + debug("Popup parameters: width: " + width + ", height: " + height + ", autoOpen: " + autoOpen); + $(this).dialog({ + closeOnEscape: true, + autoOpen: autoOpen, + height: height, + width: width, + modal: true, + resizable: true, + buttons: { + Cancel: function () { + $(this).dialog("close"); + } + }, + close: function () {} + }); }); });