summaryrefslogtreecommitdiffstats
path: root/extensions/InlineHistory
diff options
context:
space:
mode:
authorWladimir Palant <trev.moz@adblockplus.org>2013-09-25 18:20:06 +0200
committerByron Jones <bjones@mozilla.com>2013-09-25 18:20:06 +0200
commit7adf94460e6964e20f520f31db6b731ae9b88f58 (patch)
treebea2d1235d72206f92c25650c65c833aa983556c /extensions/InlineHistory
parent3d49752f959fd6c2b5e88eef8333b15705614f68 (diff)
downloadbugzilla-7adf94460e6964e20f520f31db6b731ae9b88f58.tar.gz
bugzilla-7adf94460e6964e20f520f31db6b731ae9b88f58.tar.xz
Bug 920525: make inline history more efficient when inserting elements
Diffstat (limited to 'extensions/InlineHistory')
-rw-r--r--extensions/InlineHistory/web/inline-history.js13
1 files changed, 6 insertions, 7 deletions
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 = '<div class="ih_history_item ' + containerClass + '" '
- + 'id="h' + i + '">'
- + item[3]
- + '<div class="ih_history_change">' + item[2] + '</div>'
- + '</div>';
+ var itemContainer = document.createElement('div');
+ itemContainer.className = 'ih_history_item' + containerClass;
+ itemContainer.id = 'h' + i;
+ itemContainer.innerHTML = item[3] + '<div class="ih_history_change">' + item[2] + '</div>';
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])