From: Mike Taylor Date: Tue, 6 Oct 2015 15:56:22 +0000 (+0100) Subject: Part of MKWS-413. X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=8d9192bba868d15a786b4488c79b50397c564d2e;p=mkws-moved-to-github.git Part of MKWS-413. widget.autosearch now passes the auto-searching widget into team.newSearch, and leaves it to do the configuration. --- diff --git a/src/mkws-widget.js b/src/mkws-widget.js index cb5708a..94cd6f6 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -109,28 +109,11 @@ mkws.makeWidget = function($, team, type, node) { if (widget) { widget.node.val(query); } this.team.queue("ready").subscribe(function() { - // Postpone testing for the configuration items: these are not - // yet set for Record subclass widgets that fill them in in the - // subclass, as widget.autosearch is called in the superclass, - // before the subclass fiddles with the configuration. - var sortOrder = that.config.sort; - var maxrecs = that.config.maxrecs; - var perpage = that.config.perpage; - var limit = that.config.limit; - var targets = that.config.targets; - var targetfilter = that.config.targetfilter; - var target = that.config.target; - if (target) targetfilter = 'udb=="' + target + '"'; - - var s = "running auto 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 (targetfilter) s += " constrained by targetfilter '" + targetfilter + "'"; - that.info(s); - + // Postpone search until the team is ready: configuration + // items are not yet set for Record subclass widgets that fill + // them in in the subclass, as widget.autosearch is called in + // the superclass, before the subclass fiddles with the + // configuration. that.team.newSearch(that, query, sortOrder, maxrecs, perpage, limit, targets, targetfilter); }); }