Fix error when highlighting and toping an alone thread.

This commit is contained in:
Nicolas Stepien 2012-08-06 20:41:18 +02:00
parent 7ab272005a
commit 0d136c967a
2 changed files with 7 additions and 4 deletions

View File

@ -657,8 +657,10 @@
$.addClass(root, result["class"]);
if (isOP && result.top && !g.REPLY) {
thisThread = root.parentNode;
if (firstThread = $('div[class="postContainer opContainer"]').parentNode) {
$.before(firstThread, [thisThread, thisThread.nextElementSibling]);
if (firstThread = $('div[class="postContainer opContainer"]')) {
if (firstThread !== root) {
$.before(firstThread.parentNode, [thisThread, thisThread.nextElementSibling]);
}
}
}
}

View File

@ -531,8 +531,9 @@ Filter =
# Put the highlighted OPs' thread on top of the board page...
thisThread = root.parentNode
# ...before the first non highlighted thread.
if firstThread = $('div[class="postContainer opContainer"]').parentNode
$.before firstThread, [thisThread, thisThread.nextElementSibling]
if firstThread = $ 'div[class="postContainer opContainer"]'
unless firstThread is root
$.before firstThread.parentNode, [thisThread, thisThread.nextElementSibling]
name: (post) ->
$('.name', post.el).textContent