Reorder code to bring scaffold-generation together.
authorMike Taylor <mike@indexdata.com>
Fri, 4 Apr 2014 15:30:04 +0000 (16:30 +0100)
committerMike Taylor <mike@indexdata.com>
Fri, 4 Apr 2014 15:30:04 +0000 (16:30 +0100)
src/mkws-widget-termlists.js

index 96862e9..5986a57 100644 (file)
@@ -20,10 +20,8 @@ mkws.registerWidgetType('Termlists', function() {
        // display if we first got results
        $(that.node).show();
 
-       var output = {};
        var acc = [];
        acc.push('<div class="title">' + M('Termlists') + '</div>');
-
        for (var i = 0; i < facets.length; i++) {
            var name = facets[i]
            var ref = facetConfig[name];
@@ -34,7 +32,10 @@ mkws.registerWidgetType('Termlists', function() {
                acc.push('</div>');
            }
        }
+       $(that.node).html(acc.join(''));
+
 
+       var output = {};
        for (var i = 0; i < facets.length; i++) {
            var name = facets[i]
            var ref = facetConfig[name];
@@ -45,8 +46,6 @@ mkws.registerWidgetType('Termlists', function() {
            }
        }
 
-       $(that.node).html(acc.join(''));
-
        for (var i = 0; i < facets.length; i++) {
            var name = facets[i]
            var ref = facetConfig[name];