X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-popup.js;h=6282ceb1ec902edea81d0464346dfd696fb999b7;hb=595c919870587c9ecc6e9e015213c9e39008e287;hp=48b50599cffa58b8e6c4ec9f39af24250c29162c;hpb=7f2f5aff2f7ed1b617eac2fabf669a9ed698db5d;p=mkws-moved-to-github.git diff --git a/src/mkws-popup.js b/src/mkws-popup.js index 48b5059..6282ceb 100644 --- a/src/mkws-popup.js +++ b/src/mkws-popup.js @@ -3,8 +3,8 @@ */ // "use strict"; -$(document).ready(function () { - // mkws.registerWidgetType('PopupWindow', function() { +// $(document).ready(function () { +mkws.registerWidgetType('Popup', function() { var $ = mkws.$; var debug = mkws.log; debug("init popup window"); @@ -14,7 +14,9 @@ $(document).ready(function () { return; } - var popup_window = $(".PopupWindow"); + // var popup_window = $(this.node); // + var popup_window = $(".mkwsPopup"); + if (!popup_window) { debug("no popup found, skip"); return; @@ -22,6 +24,7 @@ $(document).ready(function () { debug("found popup windows: " + popup_window.length); } + // more than one widget on a page are possible popup_window.each(function (i) { var that = $(this); @@ -45,5 +48,13 @@ $(document).ready(function () { }, close: function () {} }); + + // open at search query submit + var id_botton = that.attr("popup_button"); + if (id_botton) { + $(id_botton).button().click(function () { + that.dialog("open"); + }); + } }); });