From df2f50cc8902ba381b25d9123e81e97ee3d4a97b Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 4 Feb 2015 10:06:40 +0000 Subject: [PATCH] Fix MKWS-376. The facets and records widgets now interpret a new 'new-search-opacity' configuration setting. If it's defined, then it's an opacity in the range 0.0 (transparent) to 1.0 (opaque), and the widget fades to that opacity when a new search is submitted (reverting to full opacity when data arrives). --- src/mkws-widget-facets.js | 7 +++++++ src/mkws-widget-main.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/mkws-widget-facets.js b/src/mkws-widget-facets.js index fbf0e47..26d5d9f 100644 --- a/src/mkws-widget-facets.js +++ b/src/mkws-widget-facets.js @@ -2,7 +2,14 @@ mkws.registerWidgetType('facets', function() { // Initially hide the facets; display when we get results var that = this; var team = this.team; + + this.team.queue("searchtriggered").subscribe(function() { + var op = that.config['new-search-opacity']; + if (op !== undefined) { that.node.fadeTo(500, op); } + }); + team.queue("facets").subscribe(function(data) { + that.node.css('opacity', 1); that.node.addClass("active"); }); diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index 8fad7d9..5ddb0b3 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -114,7 +114,13 @@ mkws.registerWidgetType('records', function() { var that = this; var team = this.team; + this.team.queue("searchtriggered").subscribe(function() { + var op = that.config['new-search-opacity']; + if (op !== undefined) { that.node.fadeTo(500, op); } + }); + this.team.queue("records").subscribe(function(data) { + that.node.css('opacity', 1); for (var i = 0; i < data.hits.length; i++) { var hit = data.hits[i]; hit.detailLinkId = team.recordElementId(hit.recid[0]); -- 1.7.10.4