Add `args' argument to "onrecord" callback, so that it correctly
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index b5dc51d..870fdba 100644 (file)
@@ -281,7 +281,7 @@ function _make_mkws_team($, teamName) {
     {
        var template = loadTemplate("Summary");
        hit._id = "mkwsRec_" + hit.recid;
-       hit._onclick = "mkws.showDetails(this.id);return false;"
+       hit._onclick = "mkws.showDetails(this.id, '" + m_teamName + "');return false;"
        return template(hit);
     }
 
@@ -355,7 +355,7 @@ function _make_mkws_team($, teamName) {
     }
 
 
-    function my_onrecord(data, teamName) {
+    function my_onrecord(data, args, teamName) {
        debug("record for " + teamName);
        // FIXME: record is async!!
        clearTimeout(m_paz.recordTimer);
@@ -729,7 +729,7 @@ function _make_mkws_team($, teamName) {
 
 
     // detailed record drawing
-    mkws.showDetails = function (prefixRecId) {
+    that.showDetails = function (prefixRecId) {
        var recId = prefixRecId.replace('mkwsRec_', '');
        var oldRecId = m_curDetRecId;
        m_curDetRecId = recId;
@@ -1348,6 +1348,11 @@ function _mkws_jquery_plugin ($) {
     }
 
 
+    mkws.showDetails = function (prefixRecId, tname) {
+       mkws.teams[tname].showDetails(prefixRecId);
+    }
+
+
     function default_mkws_config() {
        /* default mkws config */
        var config_default = {