From db04b1fad38881b8a042c392f9bbd0227b75a18d Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 10 Jul 2013 14:55:10 +0000 Subject: [PATCH] configurable popup window (width, height, submit button id, popup id) --- tools/htdocs/mkws.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 4eb2f20..32b295b 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -919,11 +919,19 @@ jQuery.extend({ }); function init_popup(config) { - $("#mkwsPopup").dialog({ + if (!config) + config = {}; + + var height = config.height || 760; + var width = config.width || 880; + var id_button = config.button || "input#mkwsButton"; + var id_popup = config.popup || "#mkwsPopup"; + + $(id_popup).dialog({ closeOnEscape: true, autoOpen: false, - height: 760, - width: 880, + height: height, + width: width, modal: true, resizable: true, buttons: { @@ -931,15 +939,13 @@ function init_popup(config) { $(this).dialog("close"); } }, - close: function() { - // allFields.val( "" ).removeClass( "ui-state-error" ); - } + close: function() { } }); - $("input#mkwsButton") + $(id_button) .button() .click(function() { - $("#mkwsPopup").dialog("open"); + $(id_popup).dialog("open"); }); }; -- 1.7.10.4