X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget.js;h=cb5708ad64738513d902d89e4ba808d9df21af92;hb=a4bc69c1158498afe0c0f0eab4d2a136526b8695;hp=0ea1e0f27b239383c255e5d3c255cf0120fbb6af;hpb=f2ce887f4ff36d25b0a83cccf66271696fac03a7;p=mkws-moved-to-github.git diff --git a/src/mkws-widget.js b/src/mkws-widget.js index 0ea1e0f..cb5708a 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -104,17 +104,9 @@ mkws.makeWidget = function($, team, type, node) { var that = this; var query = this.config.autosearch; if (query) { - var old = this.team.config.query; - if (!old) { - // Stash this for subsequent inspection - this.team.config.query = query; - } else if (old === query) { - this.warn("duplicate autosearch: '" + query + "': ignoring"); - return; - } else { - this.warn("conflicting autosearch: '" + query + "' vs '" + old + "': ignoring"); - return; - } + // 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 @@ -139,7 +131,7 @@ mkws.makeWidget = function($, team, type, node) { if (targetfilter) s += " constrained by targetfilter '" + targetfilter + "'"; that.info(s); - that.team.newSearch(query, sortOrder, maxrecs, perpage, limit, targets, targetfilter); + that.team.newSearch(that, query, sortOrder, maxrecs, perpage, limit, targets, targetfilter); }); } };