From 37890f04937e3a8a55cea1b2d1a535ebed385cde Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 6 Dec 2013 18:00:40 +0000 Subject: [PATCH] Support specification of (a single) target in auto-searches. We still need to generalise this to searching multiple targets. --- tools/htdocs/mkws.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index c0171d9..67bedc6 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -417,7 +417,7 @@ function onFormSubmitEventHandler() return false; } -function newSearch(query, sort) +function newSearch(query, sort, targets) { if (!mkws.authenticated) { alert("searching before authentication"); @@ -428,7 +428,7 @@ function newSearch(query, sort) redraw_navi(); resetPage(); loadSelect(); - triggerSearch(query, sort); + triggerSearch(query, sort, targets); mkws.switchView('records'); // In case it's configured to start off as hidden submitted = true; } @@ -448,7 +448,7 @@ function resetPage() totalRec = 0; } -function triggerSearch (query, sort) +function triggerSearch (query, sort, targets) { var pp2filter = ""; var pp2limit = ""; @@ -460,6 +460,10 @@ function triggerSearch (query, sort) if (sort) { mkws.sort = sort; } + if (targets) { + // ### should support multiple |-separated targets + mkws.filters.push({ id: targets, name: targets }); + } for (var i in mkws.filters) { var filter = mkws.filters[i]; -- 1.7.10.4