From 63cd167da7164a9954a77498db2cced959e5fdb4 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Thu, 10 Jul 2014 09:11:28 +0000 Subject: [PATCH] support multiple popup windows --- src/mkws-popup.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) 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 () {} + }); }); }); -- 1.7.10.4