Add config() accessor function. Used only by widget factory.
[mkws-moved-to-github.git] / src / mkws-widgets.js
index 78e98cf..2366614 100644 (file)
@@ -13,7 +13,7 @@ function widget($, team, type, node) {
 
     that.toString = function() {
        return '[Widget ' + team.name() + ':' + type + ']';
-    }
+    };
 
     var fn = mkws.promotionFunction(type);
     if (fn) {
@@ -87,7 +87,8 @@ mkws.registerWidgetType('Termlists', function() {
        }
 
        // no facets: this should never happen
-       if (!mkws_config.facets || mkws_config.facets.length == 0) {
+       var facets = mkws.config.facets;
+       if (!facets || facets.length == 0) {
            alert("onTerm called even though we have no facets: " + $.toJSON(data));
            $(that.node).hide();
            return;
@@ -98,7 +99,6 @@ mkws.registerWidgetType('Termlists', function() {
 
        var acc = [];
        acc.push('<div class="title">' + M('Termlists') + '</div>');
-       var facets = mkws_config.facets;
 
        for (var i = 0; i < facets.length; i++) {
            if (facets[i] == "xtargets") {