X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widgets.js;h=1c37ab75b25732eefd427d76c319433de80c25ef;hb=1f129aa2f086abdb1ef1bf39f18983acc0dd9492;hp=79e83eb39992ea305b36688e7fec70a3ae023975;hpb=d4dacd0215f4f025cd15202f0aeb3ec5ccfc35fd;p=mkws-moved-to-github.git diff --git a/src/mkws-widgets.js b/src/mkws-widgets.js index 79e83eb..1c37ab7 100644 --- a/src/mkws-widgets.js +++ b/src/mkws-widgets.js @@ -59,12 +59,8 @@ function widget($, team, type, node) { } -// This is a utility function that can be used by all widgets that can -// invoke an autosearch. It properly belongs to the widget superclass, -// but since there are no classes in JavaScript there's no scope for -// it to live in, hence its being put into the mkws object. - -mkws.maybeAutosearch = function(widget) { +// Utility function for use by all widgets that can invoke autosearch. +widget.maybeAutosearch = function(widget) { var query = widget.config.autosearch; if (query) { if (query.match(/^!param!/)) { @@ -215,6 +211,8 @@ mkws.registerWidgetType('Termlists', function() { acc.push(''); } }); + + widget.maybeAutosearch(that); }); @@ -310,7 +308,7 @@ mkws.registerWidgetType('Records', function() { } }); - mkws.maybeAutosearch(that); + widget.maybeAutosearch(that); });