From a62031f009525769d52476350cee0facd91736b6 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 3 Feb 2015 12:55:51 +0800 Subject: Bug 1088082: Can't see non-comment changes after comment #0 until comment #1 appears if using description + newest to oldest comment sorting --- extensions/InlineHistory/web/inline-history.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'extensions/InlineHistory') diff --git a/extensions/InlineHistory/web/inline-history.js b/extensions/InlineHistory/web/inline-history.js index a1bfeca23..4c4452d6a 100644 --- a/extensions/InlineHistory/web/inline-history.js +++ b/extensions/InlineHistory/web/inline-history.js @@ -95,7 +95,7 @@ var inline_history = { var time = item[1]; var reachedEnd = false; - var start_index = ih_activity_sort_order == 'newest_to_oldest_desc_first' ? 1 : 0; + var start_index = (ih_activity_sort_order == 'newest_to_oldest_desc_first' && commentTimes.length > 1) ? 1 : 0; for (var j = start_index, jl = commentTimes.length; j < jl; j++) { var commentHead = commentTimes[j].parentNode; var mainUser = Dom.getElementsByClassName('email', 'a', commentHead)[0].href.substr(7); @@ -137,7 +137,11 @@ var inline_history = { if (previous && previous.className.indexOf("ih_history") >= 0) { currentDiv = this.previousElementSibling(parentDiv); } else { - parentDiv.parentNode.insertBefore(currentDiv, parentDiv); + if (commentTimes.length == 1) { + parentDiv.parentNode.insertBefore(currentDiv, parentDiv.nextSibling); + } else { + parentDiv.parentNode.insertBefore(currentDiv, parentDiv); + } } } else { var parentDiv = commentHead.parentNode; -- cgit v1.2.3-24-g4f1b