X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=be2f588853c5686ccced5497910447246ea95e14;hb=462ef80604c5f016f8a70e3a87ecbc90f33cc5d9;hp=35cfb16ff2d20c3d8528bbc0cfa48f32ab834055;hpb=b36da4a84d0742c0fce7d0f4891f078aa230079e;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index 35cfb16..be2f588 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -176,9 +176,9 @@ mkws.registerWidgetType('Perpage', function() { mkws.registerWidgetType('Done', function() { var that = this; - this.team.queue("complete").subscribe(function(n) { - that.node.html("Search complete: found " + n + " records"); + var template = that.team.loadTemplate(that.config.template || "Done"); + that.node.html(template({count: n})); }); }); @@ -186,23 +186,21 @@ mkws.registerWidgetType('Done', function() { mkws.registerWidgetType('Switch', function() { if (!this.config.show_switch) return; var tname = this.team.name(); - this.node.html('\ -Records \ -| \ -Targets'); + var output = {}; + output.recordClick = "mkws.switchView(\'" + tname + "\', \'records\')"; + output.targetClick = "mkws.switchView(\'" + tname + "\', \'targets\')"; + var template = this.team.loadTemplate(this.config.template || "Switch"); + this.node.html(template(output)); this.hideWhenNarrow(); }); mkws.registerWidgetType('Search', function() { - var tname = this.team.name(); - var M = mkws.M; - - this.node.html('\ -
\ - \ - \ -
'); + 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)); });