onFormSubmitEventHandler() is now team-aware.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 97c4867..03cd18e 100644 (file)
@@ -166,6 +166,7 @@ function team($, teamName) {
 
 
     // Needs to be defined inside team() so it can see m_debug_time
+    // ### member access won't work: there is only one instance of this function
     mkws.debug_function = function (string) {
        if (!mkws.debug_level)
            return;
@@ -425,7 +426,11 @@ function team($, teamName) {
     // when search button pressed
     function onFormSubmitEventHandler()
     {
-       that.newSearch(document.mkwsSearchForm.mkwsQuery.value);
+       mkws.handle_node_with_team(this, function (tname) {
+           var val = $('.mkwsQuery.mkwsTeam_' + tname).val();
+           mkws.teams[tname].newSearch(val);
+       });
+
        return false;
     }