Each widget now has its own config object, inheriting from the team
authorMike Taylor <mike@indexdata.com>
Fri, 28 Mar 2014 17:01:54 +0000 (17:01 +0000)
committerMike Taylor <mike@indexdata.com>
Fri, 28 Mar 2014 17:01:54 +0000 (17:01 +0000)
confirm, which inherits from the MKWS config, which inherits from the
default config. W00t!

src/mkws-widgets.js

index 2366614..2056c48 100644 (file)
@@ -3,7 +3,8 @@ function widget($, team, type, node) {
     var that = {
        team: team,
        type: type,
-       node: node
+       node: node,
+       config: Object.create(team.config())
     };
 
     function log(s) {
@@ -87,7 +88,7 @@ mkws.registerWidgetType('Termlists', function() {
        }
 
        // no facets: this should never happen
-       var facets = mkws.config.facets;
+       var facets = that.config.facets;
        if (!facets || facets.length == 0) {
            alert("onTerm called even though we have no facets: " + $.toJSON(data));
            $(that.node).hide();