From 5b0f2c074c1fee794cdec4bca1612f704ec9bca3 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 24 Mar 2014 17:25:58 +0000 Subject: [PATCH] Record elements now have team-name removed from their ID, but have the usual mkwsTeam_NAME in their CSS classes. This makes them more like widgets, and indeed they are now candidates for true widgetification. --- tools/htdocs/mkws.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index b4a52b2..02b0b55 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -349,7 +349,7 @@ function widget($, team, type, node) { for (var i = 0; i < data.hits.length; i++) { var hit = data.hits[i]; var divId = team.recordElementId(hit.recid[0]); - html.push('
', renderSummary(hit), '
'); + html.push('
', renderSummary(hit), '
'); // ### At some point, we may be able to move the // m_currentRecordId and m_currentRecordData members // from the team object into this widget. @@ -541,8 +541,7 @@ function team($, teamName) { var detRecordDiv = document.getElementById('mkwsDet_' + teamName + '_' + data.recid); if (detRecordDiv) return; m_currentRecordData = data; - // Can't use jQuery's $('#x') syntax to find this ID, because it contains spaces. - var recordDiv = document.getElementById(recordElementId(m_currentRecordData.recid[0])); + var recordDiv = findnode(recordElementId(m_currentRecordData.recid[0])); var html = renderDetails(m_currentRecordData); $(recordDiv).append(html); } @@ -550,7 +549,7 @@ function team($, teamName) { // Used by promoteRecords() and onRecord() function recordElementId(s) { - return 'mkwsRec_' + m_teamName + '_' + s.replace(/[^a-z0-9]/ig, '_'); + return 'mkwsRec_' + s.replace(/[^a-z0-9]/ig, '_'); } that.recordElementId = recordElementId; -- 1.7.10.4