Register widget-types only once, at the end.
authorMike Taylor <mike@indexdata.com>
Wed, 26 Mar 2014 17:07:01 +0000 (17:07 +0000)
committerMike Taylor <mike@indexdata.com>
Wed, 26 Mar 2014 17:07:01 +0000 (17:07 +0000)
src/mkws-widgets.js

index 9ba58bb..5f25cd6 100644 (file)
@@ -15,15 +15,6 @@ function widget($, team, type, node) {
        return '[Widget ' + team.name() + ':' + type + ']';
     }
 
-    mkws.registerWidgetType('Targets', promoteTargets);
-    mkws.registerWidgetType('Stat', promoteStat);
-    mkws.registerWidgetType('Termlists', promoteTermlists);
-    mkws.registerWidgetType('Pager', promotePager);
-    mkws.registerWidgetType('Records', promoteRecords);
-    mkws.registerWidgetType('Navi', promoteNavi);
-    mkws.registerWidgetType('Sort', promoteSort);
-    mkws.registerWidgetType('Perpage', promotePerpage);
-
     var promote = mkws.promotionFunction(type);
     if (promote) {
        promote.call(that);
@@ -298,3 +289,13 @@ function widget($, team, type, node) {
            return false;
        });
     }
+
+    mkws.registerWidgetType('Targets', promoteTargets);
+    mkws.registerWidgetType('Stat', promoteStat);
+    mkws.registerWidgetType('Termlists', promoteTermlists);
+    mkws.registerWidgetType('Pager', promotePager);
+    mkws.registerWidgetType('Records', promoteRecords);
+    mkws.registerWidgetType('Navi', promoteNavi);
+    mkws.registerWidgetType('Sort', promoteSort);
+    mkws.registerWidgetType('Perpage', promotePerpage);
+