Get page numbers from Index.threadPosition.
This commit is contained in:
parent
b64b513841
commit
80b350b3a6
@ -591,9 +591,11 @@ Index =
|
|||||||
Index.liveThreadData = pages.reduce ((arr, next) -> arr.concat next.threads), []
|
Index.liveThreadData = pages.reduce ((arr, next) -> arr.concat next.threads), []
|
||||||
Index.liveThreadIDs = Index.liveThreadData.map (data) -> data.no
|
Index.liveThreadIDs = Index.liveThreadData.map (data) -> data.no
|
||||||
Index.liveThreadDict = {}
|
Index.liveThreadDict = {}
|
||||||
|
Index.threadPosition = {}
|
||||||
Index.parsedThreads = {}
|
Index.parsedThreads = {}
|
||||||
for data in Index.liveThreadData
|
for data, i in Index.liveThreadData
|
||||||
Index.liveThreadDict[data.no] = data
|
Index.liveThreadDict[data.no] = data
|
||||||
|
Index.threadPosition[data.no] = i
|
||||||
Index.parsedThreads[data.no] = obj = Build.parseJSON data, g.BOARD.ID
|
Index.parsedThreads[data.no] = obj = Build.parseJSON data, g.BOARD.ID
|
||||||
obj.filterResults = results = Filter.test obj
|
obj.filterResults = results = Filter.test obj
|
||||||
obj.isOnTop = results.top
|
obj.isOnTop = results.top
|
||||||
@ -614,7 +616,7 @@ Index =
|
|||||||
return unless Index.liveThreadData
|
return unless Index.liveThreadData
|
||||||
threads = []
|
threads = []
|
||||||
posts = []
|
posts = []
|
||||||
for threadData, i in Index.liveThreadData
|
for threadData in Index.liveThreadData
|
||||||
try
|
try
|
||||||
if (thread = g.BOARD.threads[threadData.no])
|
if (thread = g.BOARD.threads[threadData.no])
|
||||||
thread.setCount 'post', threadData.replies + 1, threadData.bumplimit
|
thread.setCount 'post', threadData.replies + 1, threadData.bumplimit
|
||||||
@ -633,7 +635,7 @@ Index =
|
|||||||
OP = new Post Build.post(obj, true), thread, g.BOARD
|
OP = new Post Build.post(obj, true), thread, g.BOARD
|
||||||
OP.filterResults = obj.filterResults
|
OP.filterResults = obj.filterResults
|
||||||
posts.push OP
|
posts.push OP
|
||||||
thread.setPage i // Index.threadsNumPerPage + 1
|
thread.setPage(Index.threadPosition[threadData.no] // Index.threadsNumPerPage + 1)
|
||||||
|
|
||||||
Build.thread thread, threadData
|
Build.thread thread, threadData
|
||||||
catch err
|
catch err
|
||||||
@ -675,8 +677,10 @@ Index =
|
|||||||
buildCatalogViews: (threads) ->
|
buildCatalogViews: (threads) ->
|
||||||
catalogThreads = []
|
catalogThreads = []
|
||||||
for thread in threads when !thread.catalogView
|
for thread in threads when !thread.catalogView
|
||||||
i = Index.liveThreadIDs.indexOf thread.ID
|
{ID} = thread
|
||||||
root = Build.catalogThread thread, Index.liveThreadData[i], i // Index.threadsNumPerPage + 1
|
i = Index.threadPosition[ID]
|
||||||
|
page = Index.threadPosition[ID] // Index.threadsNumPerPage + 1
|
||||||
|
root = Build.catalogThread thread, Index.liveThreadDict[ID], page
|
||||||
catalogThreads.push new CatalogThread root, thread
|
catalogThreads.push new CatalogThread root, thread
|
||||||
Main.callbackNodes 'CatalogThread', catalogThreads
|
Main.callbackNodes 'CatalogThread', catalogThreads
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user