From: Mike Taylor Date: Wed, 2 Apr 2014 16:06:29 +0000 (+0100) Subject: Move the maybeAutosearch widget from the mkws namespace into the widget namespace. X-Git-Tag: 1.0.0~1083 X-Git-Url: http://jsfdemo.indexdata.com/?a=commitdiff_plain;h=d26ab9999daa36225232281061ab1f7ef3c1d02f;p=mkws-moved-to-github.git Move the maybeAutosearch widget from the mkws namespace into the widget namespace. --- diff --git a/src/mkws-widgets.js b/src/mkws-widgets.js index 79e83eb..7f218be 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!/)) { @@ -310,7 +306,7 @@ mkws.registerWidgetType('Records', function() { } }); - mkws.maybeAutosearch(that); + widget.maybeAutosearch(that); });