Make addSingleScaffold private to the loop that uses it.
authorMike Taylor <mike@indexdata.com>
Fri, 4 Apr 2014 15:26:32 +0000 (16:26 +0100)
committerMike Taylor <mike@indexdata.com>
Fri, 4 Apr 2014 15:26:32 +0000 (16:26 +0100)
src/mkws-widget-termlists.js

index 135f322..166c853 100644 (file)
@@ -31,6 +31,11 @@ mkws.registerWidgetType('Termlists', function() {
                alert("bad facet configuration: '" + name + "'");
            } else {
                addSingleScaffold(acc, ref[0]);
+               function addSingleScaffold(acc, caption) {
+                   var teamName = that.team.name();
+                   acc.push('<div class="mkwsFacet mkwsFacet' + caption + ' mkwsTeam_' + teamName + '">');
+                   acc.push('</div>');
+               }
            }
        }
 
@@ -55,12 +60,6 @@ mkws.registerWidgetType('Termlists', function() {
            that.team.findnode('.mkwsFacet' + caption).html(output[name]);
        }
 
-       function addSingleScaffold(acc, caption) {
-           var teamName = that.team.name();
-           acc.push('<div class="mkwsFacet mkwsFacet' + caption + ' mkwsTeam_' + teamName + '">');
-           acc.push('</div>');
-       }
-
 
        function makeSingleFacet(caption, data, max, pzIndex) {
            var teamName = that.team.name();