Fixes problem with ChPage's registerWidget, and adds setMaxWidgets method.
authorSalvatore Iovene <salvatore.iovene@intel.com>
Wed, 16 Jan 2013 08:56:32 +0000 (10:56 +0200)
committerSalvatore Iovene <salvatore.iovene@intel.com>
Wed, 16 Jan 2013 08:56:32 +0000 (10:56 +0200)
src/javascripts/cowhide-page.js

index 4e0f26c..4bca97d 100644 (file)
                                     this.options.maxWidgets +
                                     " widgets.");
                 }
+            },
+
+            setMaxWidgets: function(value) {
+              this.options.maxWidgets = value;
             }
         }
     );
 
-    $.fn.ch_page = function(option) {
+    $.fn.ch_page = function(option, value) {
         return this.each(function() {
             var $this = $(this),
                 data = $this.data('ch_page'),
             }
 
             if(option == 'register') {
-                data.registerWidget();
+                data.registerWidget(value);
+            }
+
+            if(option == 'setMaxWidgets') {
+              data.setMaxWidgets(value);
             }
         });
     };