From fd71e199523e8cbfea692732cfe9ff361a050b35 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 24 Jan 2014 15:09:48 +0000 Subject: [PATCH] Results and Termlist HTML now set using $("#x").html() replaceHtml() no longer used, and is removed. --- tools/htdocs/mkws.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 1837390..604d509 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -262,7 +262,7 @@ function _make_mkws_team($, teamName) { } // navi - var results = document.getElementById("mkwsRecords"); + var results = $("#mkwsRecords"); var html = []; for (var i = 0; i < data.hits.length; i++) { @@ -274,7 +274,7 @@ function _make_mkws_team($, teamName) { html.push(renderDetails(m_curDetRecData)); } } - replaceHtml(results, html.join('')); + results.html(html.join('')); } @@ -328,9 +328,9 @@ function _make_mkws_team($, teamName) { } } - var termlist = document.getElementById("mkwsTermlists"); + var termlist = $("#mkwsTermlists"); if (termlist) - replaceHtml(termlist, acc.join('')); + termlist.html(acc.join('')); } @@ -745,21 +745,6 @@ function _make_mkws_team($, teamName) { } - function replaceHtml(el, html) { - var oldEl = typeof el === "string" ? document.getElementById(el) : el; - /*@cc_on // Pure innerHTML is slightly faster in IE - oldEl.innerHTML = html; - return oldEl; - @*/ - var newEl = oldEl.cloneNode(false); - newEl.innerHTML = html; - oldEl.parentNode.replaceChild(newEl, oldEl); - /* Since we just removed the old element from the DOM, return a reference - to the new element, which can be used to restore variable references. */ - return newEl; - }; - - function renderDetails(data, marker) { var template = loadTemplate("Record"); -- 1.7.10.4