Pull Index references out of Build.catalogThread.

This commit is contained in:
ccd0 2016-09-25 05:35:13 -07:00
parent 378d2be2da
commit 3997cf354d
2 changed files with 4 additions and 4 deletions

View File

@ -181,9 +181,8 @@ Build =
$.add root, summary
root
catalogThread: (thread) ->
catalogThread: (thread, data, pageCount) ->
{staticPath, gifIcon} = Build
data = Index.liveThreadDict[thread.ID]
if data.spoiler and !Conf['Reveal Spoiler Thumbnails']
src = "#{staticPath}spoiler"
@ -203,7 +202,6 @@ Build =
postCount = data.replies + 1
fileCount = data.images + !!data.ext
pageCount = Index.liveThreadIDs.indexOf(thread.ID) // Index.threadsNumPerPage + 1
root = $.el 'div',
className: 'catalog-thread post' # post added to make 4chan postInfo CSS work

View File

@ -632,7 +632,9 @@ Index =
buildCatalogViews: (threads) ->
catalogThreads = []
for thread in threads when !thread.catalogView
catalogThreads.push new CatalogThread Build.catalogThread(thread), thread
i = Index.liveThreadIDs.indexOf thread.ID
root = Build.catalogThread thread, Index.liveThreadData[i], i // Index.threadsNumPerPage + 1
catalogThreads.push new CatalogThread root, thread
Main.callbackNodes 'CatalogThread', catalogThreads
threads.map (thread) -> thread.catalogView.nodes.root