From 62694fd7834cf725b2820100388afeeb4e9fddba Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 26 Mar 2014 11:45:34 +0000 Subject: [PATCH] Eliminate function onFormSubmitEventHandler, use closure instead. --- src/mkws-team.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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(); }); -- 1.7.10.4