Proper (non-hacky) fix for SUP-807.
authorMike Taylor <mike@indexdata.com>
Tue, 13 Oct 2015 21:17:46 +0000 (22:17 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 13 Oct 2015 21:17:46 +0000 (22:17 +0100)
team.newSearch now rightly looks in the widget for configuration, not
in the team. This means that configuration items set directly in the
widget itself (such as the "target" setting in the Wikipedia and
Reference Universe widgets) are now found, whereas previously only
settings that had been established at the team level or higher -- such
as the targetfilter categories of us.openrepo.net -- were found.

src/mkws-team.js

index 7126abd..8c81a1a 100644 (file)
@@ -297,13 +297,13 @@ mkws.makeTeam = function($, teamName) {
     }
 
     {
-      if (!sortOrder) sortOrder = that.config.sort;
-      if (!maxrecs) maxrecs = that.config.maxrecs;
-      if (!perpage) perpage = that.config.perpage;
-      if (!limit) limit = that.config.limit;
-      if (!targets) targets = that.config.targets;
-      if (!torusquery) torusquery = that.config.targetfilter;
-      var target = that.config.target;
+      if (!sortOrder) sortOrder = widget.config.sort;
+      if (!maxrecs) maxrecs = widget.config.maxrecs;
+      if (!perpage) perpage = widget.config.perpage;
+      if (!limit) limit = widget.config.limit;
+      if (!targets) targets = widget.config.targets;
+      if (!torusquery) torusquery = widget.config.targetfilter;
+      var target = widget.config.target;
       if (target) torusquery = 'udb=="' + target + '"';
 
       var s = "running search: '" + query + "'";