Set full-record HTML using jQuery rather than innerHTML.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 1c19b2c..3a44f46 100644 (file)
@@ -170,6 +170,10 @@ function widget($, team, type, node) {
     return that;
 
 
+    // Functions follow for promoting the regular widget object into
+    // widgets of specific types. These could be moved outside of the
+    // widget object, or even into their own source files.
+
     function promoteTargets() {
        team.queue("targets").subscribe(function(data) {
            if (node.length === 0) alert("huh?!");
@@ -365,9 +369,10 @@ function team($, teamName) {
        var detRecordDiv = document.getElementById('mkwsDet_' + teamName + '_' + data.recid);
        if (detRecordDiv) return;
        m_curDetRecData = data;
+       // Can't use jQuery's $('#x') syntax to find this ID, because it contains spaces.
        var recordDiv = document.getElementById('mkwsRecdiv_' + teamName + '_' + m_curDetRecData.recid);
        var html = renderDetails(m_curDetRecData);
-       recordDiv.innerHTML += html;
+       $(recordDiv).append(html);
     }