Support "target" config element as a shortcut for UDB search using targetfilter.
authorMike Taylor <mike@indexdata.com>
Thu, 3 Apr 2014 16:16:16 +0000 (17:16 +0100)
committerMike Taylor <mike@indexdata.com>
Thu, 3 Apr 2014 16:16:16 +0000 (17:16 +0100)
src/mkws-widgets.js

index 0f58002..551527c 100644 (file)
@@ -87,6 +87,8 @@ widget.autosearch = function(widget) {
            var limit = widget.config.limit;
            var targets = widget.config.targets;
            var targetfilter = widget.config.targetfilter;
+           var target = widget.config.target;
+           if (target) targetfilter = 'udb=="' + target + '"';
 
            var s = "running auto search: '" + query + "'";
            if (sortOrder) s += " sorted by '" + sortOrder + "'";