Eliminate function onFormSubmitEventHandler, use closure instead.
authorMike Taylor <mike@indexdata.com>
Wed, 26 Mar 2014 11:45:34 +0000 (11:45 +0000)
committerMike Taylor <mike@indexdata.com>
Wed, 26 Mar 2014 11:45:34 +0000 (11:45 +0000)
src/mkws-team.js

index 98d586e..bbb59a9 100644 (file)
@@ -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(); });