From 261a90e3a7ca89560b502b474b0a062f9febf6c6 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 27 May 2014 17:10:08 +0100 Subject: [PATCH] Move all config inspection inside the "ready" handler. --- src/mkws-widget.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/mkws-widget.js b/src/mkws-widget.js index d0a40ca..d1c76b4 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -133,18 +133,17 @@ widget.autosearch = function(widget) { } } - var sortOrder = widget.config.sort; - var maxrecs = widget.config.maxrecs; - var perpage = widget.config.perpage; - var limit = widget.config.limit; - var targets = widget.config.targets; - var targetfilter = widget.config.targetfilter; - widget.team.queue("ready").subscribe(function() { - // Postpone testing for the target configuration item: this is - // not set at compile-time for Record subclass widgets that set - // it in the subclass, as widget.autosearch is called in the - // superclass, before the subclass fiddles with the configuration. + // 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 = widget.config.sort; + var maxrecs = widget.config.maxrecs; + var perpage = widget.config.perpage; + var limit = widget.config.limit; + var targets = widget.config.targets; + var targetfilter = widget.config.targetfilter; var target = widget.config.target; if (target) targetfilter = 'udb=="' + target + '"'; -- 1.7.10.4