X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=c1a58ef43e8d9508d44b2257d50a5e584cb05cc7;hb=79df7635c4cf890fdb06683a824d212b64a4a9bf;hp=0ee99f3c8973cc11bd246a53e3179fe1cf5073e4;hpb=36721667730b5d8aae5b6df304f69d96f2c1d21d;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index 0ee99f3..c1a58ef 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -22,6 +22,7 @@ mkws.registerWidgetType('targets', function() { cur.id = data[i].id; cur.hits = data[i].hits; cur.diagnostic = data[i].diagnostic; + cur.message = data[i].message; cur.records = data[i].records; cur.state = data[i].state; cleandata.push(cur); @@ -55,7 +56,7 @@ mkws.registerWidgetType('pager', function() { output.found = data.total; //client indexes pages from 1 but pz2 from 0 - var onsides = 6; + var onsides = 5; var pages = Math.ceil(that.team.totalRecordCount() / that.team.perpage()); var currentPage = that.team.currentPage(); @@ -99,13 +100,11 @@ 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)); } }); - that.autosearch(); }); mkws.registerWidgetType('records', function() { @@ -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,8 +128,9 @@ mkws.registerWidgetType('records', function() { } } var template = team.loadTemplate(that.config.template || "records"); - var targs = $.extend({}, {"hits": data.hits}, that.config.template_vars); - that.node.html(template(targs)); + 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}})); }); that.autosearch(); @@ -221,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)); }); @@ -287,7 +285,7 @@ mkws.registerWidgetType('lang', function() { var list = []; /* display a list of configured languages, or all */ - var lang_options = this.config.lang_options || []; + var lang_options = this.config.lang_options; var toBeIncluded = {}; for (var i = 0; i < lang_options.length; i++) { toBeIncluded[lang_options[i]] = true;