From 7adf94460e6964e20f520f31db6b731ae9b88f58 Mon Sep 17 00:00:00 2001 From: Wladimir Palant Date: Thu, 26 Sep 2013 00:20:06 +0800 Subject: Bug 920525: make inline history more efficient when inserting elements --- extensions/InlineHistory/web/inline-history.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'extensions/InlineHistory') diff --git a/extensions/InlineHistory/web/inline-history.js b/extensions/InlineHistory/web/inline-history.js index a956f0337..2c63107d3 100644 --- a/extensions/InlineHistory/web/inline-history.js +++ b/extensions/InlineHistory/web/inline-history.js @@ -126,16 +126,15 @@ var inline_history = { } } - var itemHtml = '
' - + item[3] - + '
' + item[2] + '
' - + '
'; + var itemContainer = document.createElement('div'); + itemContainer.className = 'ih_history_item' + containerClass; + itemContainer.id = 'h' + i; + itemContainer.innerHTML = item[3] + '
' + item[2] + '
'; if (ih_activity_sort_order == 'oldest_to_newest') { - currentDiv.innerHTML = currentDiv.innerHTML + itemHtml; + currentDiv.appendChild(itemContainer); } else { - currentDiv.innerHTML = itemHtml + currentDiv.innerHTML; + currentDiv.insertBefore(itemContainer, currentDiv.firstChild); } currentDiv.setAttribute("class", "bz_comment ih_history"); if (item[6]) -- cgit v1.2.3-24-g4f1b