Template waiting widget MKWS-375
authorJason Skomorowski <jason@indexdata.com>
Fri, 6 Feb 2015 16:01:16 +0000 (11:01 -0500)
committerJason Skomorowski <jason@indexdata.com>
Fri, 6 Feb 2015 16:01:16 +0000 (11:01 -0500)
src/mkws-widget-main.js
src/templates/waiting.handlebars [new file with mode: 0644]

index 2a68283..22a5f59 100644 (file)
@@ -388,8 +388,10 @@ mkws.registerWidgetType('waiting', function() {
   var that = this;
 
   this.node.css("visibility", "hidden");
-  var src = this.config.src || "http://mkws.indexdata.com/progress.gif";
-  this.node.html('<img src="' + src + '"/>');
+  var template = that.team.loadTemplate(that.config.template || "waiting");
+  this.node.html(template({
+    src: this.config.src || "http://mkws.indexdata.com/progress.gif"
+  }));
 
   this.team.queue("searchtriggered").subscribe(function(data) {
     that.node.css("visibility", "visible");
diff --git a/src/templates/waiting.handlebars b/src/templates/waiting.handlebars
new file mode 100644 (file)
index 0000000..b9c1ab4
--- /dev/null
@@ -0,0 +1,6 @@
+{{!
+Search activity indicator
+
+src - image to display when active
+}}
+<img src="{{src}}"/>