From: Mike Taylor Date: Wed, 26 Mar 2014 11:45:34 +0000 (+0000) Subject: Eliminate function onFormSubmitEventHandler, use closure instead. X-Git-Tag: 1.0.0~1196 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=62694fd7834cf725b2820100388afeeb4e9fddba Eliminate function onFormSubmitEventHandler, use closure instead. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index 98d586e..bbb59a9 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -157,15 +157,6 @@ function team($, teamName) { //////////////////////////////////////////////////////////////////////////////// - // when search button pressed - function onFormSubmitEventHandler() - { - var val = findnode('.mkwsQuery').val(); - newSearch(val); - return false; - } - - // limit by target functions that.limitTarget = function (id, name) { @@ -444,7 +435,11 @@ function team($, teamName) { mkwsHtmlSwitch(); - findnode('.mkwsSearchForm').submit(onFormSubmitEventHandler); + findnode('.mkwsSearchForm').submit(function() { + var val = findnode('.mkwsQuery').val(); + newSearch(val); + return false; + }); // on first page, hide the termlist $(document).ready(function() { findnode(".mkwsTermlists").hide(); });