From: Mike Taylor Date: Fri, 28 Mar 2014 17:01:54 +0000 (+0000) Subject: Each widget now has its own config object, inheriting from the team X-Git-Tag: 1.0.0~1131 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=b0aa9bab78f0357d90040cbfbc1f25d4bdcddeb1;p=mkws-moved-to-github.git Each widget now has its own config object, inheriting from the team confirm, which inherits from the MKWS config, which inherits from the default config. W00t! --- diff --git a/src/mkws-widgets.js b/src/mkws-widgets.js index 2366614..2056c48 100644 --- a/src/mkws-widgets.js +++ b/src/mkws-widgets.js @@ -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();