X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=7126abd4421a4f7ddfe4e7989117859899827f87;hb=8d9192bba868d15a786b4488c79b50397c564d2e;hp=e4645b2651aabbef1cc0b7bb5070af805ff071c9;hpb=998e04b1f3fe6c198a333347ee7f973cf04954b3;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index e4645b2..7126abd 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -288,7 +288,7 @@ mkws.makeTeam = function($, teamName) { that.resetPage = resetPage; - function newSearch(query, sortOrder, maxrecs, perpage, limit, targets, torusquery) { + function newSearch(widget, query, sortOrder, maxrecs, perpage, limit, targets, torusquery) { that.info("newSearch: " + query); if (config.use_service_proxy && !mkws.authenticated) { @@ -296,6 +296,26 @@ mkws.makeTeam = function($, teamName) { return; } + { + 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 (target) torusquery = 'udb=="' + target + '"'; + + var s = "running search: '" + query + "'"; + if (sortOrder) s += " sorted by '" + sortOrder + "'"; + if (maxrecs) s += " restricted to " + maxrecs + " records"; + if (perpage) s += " with " + perpage + " per page"; + if (limit) s += " limited by '" + limit + "'"; + if (targets) s += " in targets '" + targets + "'"; + if (torusquery) s += " constrained by torusquery '" + torusquery + "'"; + that.info(s); + } + m_filterSet.removeMatching(function(f) { return f.type !== 'category' }); triggerSearch(query, sortOrder, maxrecs, perpage, limit, targets, torusquery); switchView('records'); // In case it's configured to start off as hidden @@ -306,7 +326,6 @@ mkws.makeTeam = function($, teamName) { function triggerSearch(query, sortOrder, maxrecs, perpage, limit, targets, torusquery) { resetPage(); - queue("navi").publish(); // Continue to use previous query/sort-order unless new ones are specified if (query) m_query = query; @@ -334,6 +353,7 @@ mkws.makeTeam = function($, teamName) { "pp2filter = " + pp2filter + ", params = " + $.toJSON(params)); m_paz.search(m_query, m_perpage, m_sortOrder, pp2filter, undefined, params); + queue("searchtriggered").publish(); } // fetch record details to be retrieved from the record queue @@ -499,8 +519,7 @@ mkws.makeTeam = function($, teamName) { } } return undefined; - } - + }; return that; };