Simplify Build.thread arguments.

This commit is contained in:
ccd0 2016-09-25 14:25:51 -07:00
parent 49a74fe6e1
commit 378d2be2da
2 changed files with 5 additions and 5 deletions

View File

@ -162,22 +162,22 @@ Build =
textContent: Build.summaryText '', posts, files
href: "/#{boardID}/thread/#{threadID}"
thread: (board, data, OP) ->
if (root = OP.nodes.root.parentNode)
thread: (thread, data) ->
if (root = thread.OP.nodes.root.parentNode)
$.rmAll root
else
root = $.el 'div',
className: 'thread'
id: "t#{data.no}"
$.add root, Build.hat.cloneNode(false) if Build.hat
$.add root, OP.nodes.root
$.add root, thread.OP.nodes.root
if data.omitted_posts or !Conf['Show Replies'] and data.replies
[posts, files] = if Conf['Show Replies']
# XXX data.omitted_images is not accurate.
[data.omitted_posts, data.images - data.last_replies.filter((data) -> !!data.ext).length]
else
[data.replies, data.images]
summary = Build.summary board.ID, data.no, posts, files
summary = Build.summary thread.board.ID, data.no, posts, files
$.add root, summary
root

View File

@ -592,7 +592,7 @@ Index =
posts.push OP
thread.setPage i // Index.threadsNumPerPage + 1
Index.nodes[thread.ID] = Build.thread g.BOARD, threadData, OP
Index.nodes[thread.ID] = Build.thread thread, threadData
catch err
# Skip posts that we failed to parse.
errors = [] unless errors