From 3997cf354d382df483e54069a6ea6d9271fb4120 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 25 Sep 2016 05:35:13 -0700 Subject: [PATCH] Pull Index references out of Build.catalogThread. --- src/General/Build.coffee | 4 +--- src/General/Index.coffee | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 521a8bb42..39b796a51 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -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 diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 79632ee45..cd455cbd7 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -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