FIx comment.
[mkws-moved-to-github.git] / src / mkws-widget-main.js
index 53e2f5c..463172d 100644 (file)
@@ -100,7 +100,6 @@ mkws.registerWidgetType('details', function() {
     });
   }
   this.team.queue("record").subscribe(function(data) {
-    console.log(data);
     if ($.inArray(recid, data.recid) > -1) {
       var template = that.team.loadTemplate(that.config.template || "details");
       that.node.html(template(data));
@@ -115,7 +114,6 @@ mkws.registerWidgetType('records', function() {
   this.team.queue("records").subscribe(function(data) {
     for (var i = 0; i < data.hits.length; i++) {
       var hit = data.hits[i];
-      that.team.queue("record").publish(hit);
       hit.detailLinkId = team.recordElementId(hit.recid[0]);
       hit.detailClick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;";
       hit.containerClass = "mkws-summary mkwsSummary mkws-team-" + team.name();
@@ -130,7 +128,7 @@ mkws.registerWidgetType('records', function() {
       }
     }
     var template = team.loadTemplate(that.config.template || "records");
-    var summaryPartial = team.loadTemplate("summary");
+    var summaryPartial = team.loadTemplate(that.config['summary-template'] || "summary");
     var tdata = $.extend({}, {"hits": data.hits}, that.config.template_vars);
     that.node.html(template(tdata, {"partials":{"summary":summaryPartial}}));
   });
@@ -222,7 +220,6 @@ mkws.registerWidgetType('switch', function() {
 mkws.registerWidgetType('search', function() {
   var output = {};
   output.team = this.team.name();
-  output.queryWidth = this.config.query_width;
   var template = this.team.loadTemplate(this.config.template || "search");
   this.node.html(template(output));
 });
@@ -254,7 +251,7 @@ mkws.registerWidgetType('ranking', function() {
   output.showPerPage = this.config.show_perpage;
 
   var order = this.team.sortOrder();
-  this.log("making sort, sortOrder = '" + order + "'");
+  this.info("making sort, sortOrder = '" + order + "'");
   for (var i = 0; i < this.config.sort_options.length; i++) {
     var cur = {};
     var opt = this.config.sort_options[i];
@@ -265,7 +262,7 @@ mkws.registerWidgetType('ranking', function() {
   }
 
   var perpage = this.team.perpage();
-  this.log("making perpage, perpage = " + perpage);
+  this.info("making perpage, perpage = " + perpage);
   for(var i = 0; i < this.config.perpage_options.length; i++) {
     var cur = {};
     cur.perPage = this.config.perpage_options[i];
@@ -313,7 +310,7 @@ mkws.registerWidgetType('lang', function() {
       list.push(cur);
   }
 
-  this.log("language menu: " + list.join(", "));
+  this.info("language menu: " + list.join(", "));
 
   var template = this.team.loadTemplate(this.config.template || "lang");
   this.node.html(template({languages: list}));
@@ -358,7 +355,7 @@ mkws.registerWidgetType('config', function() {
   for (var name in c) {
     if (c.hasOwnProperty(name)) {
       this.team.config[name] = c[name];
-      this.log(this + " copied property " + name + "='" + c[name] + "' up to team");
+      this.info(this + " copied property " + name + "='" + c[name] + "' up to team");
     }
   }
 });