Make renderDetails() available as team member-function.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 64e7351..0ff94ff 100644 (file)
@@ -160,19 +160,24 @@ function widget($, team, type, node) {
 
     if (type === 'Targets') {
        promoteTargets();
+       team.debug("made targets widget(node=" + node + ")");
     } else if (type === 'Stat') {
        promoteStat();
+       team.debug("made stat widget(node=" + node + ")");
     } else if (type === 'Termlists') {
        promoteTermlists();
+       team.debug("made termlists widget(node=" + node + ")");
     } else if (type === 'Pager') {
        promotePager();
+       team.debug("made pager widget(node=" + node + ")");
     } else if (type === 'Records') {
        promoteRecords();
+       team.debug("made records widget(node=" + node + ")");
     } else {
        // ### Handle other types here
+       team.debug("made unencapsulated widget(type=" + type + ", node=" + node + ")");
     }
 
-    mkws.debug("made widget(team=" + team + ", type=" + type + ", node=" + node);
     return that;
 
 
@@ -355,7 +360,7 @@ function widget($, team, type, node) {
                // from the team object into this widget.
                if (hit.recid == team.currentRecordId()) {
                    if (team.currentRecordData())
-                       html.push(renderDetails(team.currentRecordData()));
+                       html.push(team.renderDetails(team.currentRecordData()));
                }
            }
            $(node).html(html.join(''));
@@ -414,6 +419,7 @@ function team($, teamName) {
 
        mkws.debug(m_teamName + ": " + timestamp + s);
     }
+    that.debug = debug;
 
     debug("start running MKWS");
 
@@ -1068,6 +1074,7 @@ function team($, teamName) {
        var details = template(data);
        return '<div class="details" id="mkwsDet_' + m_teamName + '_' + data.recid + '">' + details + '</div>';
     }
+    that.renderDetails = renderDetails;
 
 
     function loadTemplate(name)