X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmkws-widget.js;h=45b0b40b602c854eb2dbd77870938419fe92b125;hb=f1a3747154ae806819f2fdde90939bdf78444e3e;hp=05e39ca2ee9ca0e6026d2ab3454bfff08a4635b6;hpb=699f025fbabc9fffb5f78e9f4f927ccdd9fdb936;p=mkws-moved-to-github.git diff --git a/src/mkws-widget.js b/src/mkws-widget.js index 05e39ca..45b0b40 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -104,30 +104,20 @@ mkws.makeWidget = function($, team, type, node) { var that = this; var query = this.config.autosearch; if (query) { + // Should do this more elegantly with message passing + var widget = this.team.widget('query'); + 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; + // 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. + var torusquery = undefined; 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); - - that.team.newSearch(query, sortOrder, maxrecs, perpage, limit, targets, targetfilter); + if (target) torusquery = 'udb=="' + target + '"'; + that.team.newSearch(that, query, undefined, undefined, undefined, undefined, undefined, torusquery); }); } };