From fd831c63e414e24a0c596d93beb35f41c73762e5 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 4 Feb 2015 13:38:46 +0000 Subject: [PATCH] Towards MKWS-375. Add new "waiting" widget. --- src/mkws-widget-main.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index e5c14ef..2a68283 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -384,6 +384,22 @@ mkws.registerWidgetType('progress', function() { }); +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(''); + + this.team.queue("searchtriggered").subscribe(function(data) { + that.node.css("visibility", "visible"); + }); + this.team.queue("complete").subscribe(function(n) { + that.node.css("visibility", "hidden"); + }); +}); + + // Some elements have mkws* classes that makes them appear as widgets // -- for example, because we want to style them using CSS -- but have // no actual functionality. We register these to prevent ignorable -- 1.7.10.4