From d26ab9999daa36225232281061ab1f7ef3c1d02f Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 2 Apr 2014 17:06:29 +0100 Subject: [PATCH] Move the maybeAutosearch widget from the mkws namespace into the widget namespace. --- src/mkws-widgets.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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); }); -- 1.7.10.4