Add another Handlebars helper, "compare".
[mkws-moved-to-github.git] / src / mkws-popup.js
index 44736cc..54ef152 100644 (file)
@@ -4,13 +4,13 @@
 
 //"use strict";
 // $(document).ready(function () {
-mkws.registerWidgetType('Popup', function() {
+mkws.registerWidgetType('popup', function() {
     var $ = mkws.$;
-    var debug = mkws.log;
+    var debug = this.info;
     debug("init popup window");
 
-    var popup_window = $(this.node); // mkws.registerWidgetType('Popup',....)
-    // var popup_window = $(".mkwsPopup"); // $(document).ready()
+    var popup_window = $(this.node);
+    // var popup_window = $(".mkws-popup mkwsPopup"); // $(document).ready()
     if (!popup_window) {
         debug("no popup found, skip...");
         return;
@@ -27,6 +27,7 @@ mkws.registerWidgetType('Popup', function() {
     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");
@@ -48,7 +49,7 @@ mkws.registerWidgetType('Popup', function() {
             close: function() {}
         });
 
-        // open at search query submit
+        // open at search query submit: "input.mkws-button mkwsButton"
         var id_botton = that.attr("popup_button");
         if (id_botton) {
             $(id_botton).button().click(function() {