Move Index.buildThreads call into buildStructure / buildCatalog.
This commit is contained in:
parent
0f283df4fa
commit
7f64cd9c26
@ -160,8 +160,7 @@ Index =
|
|||||||
return Index.endNotice() if pageNum > Index.pagesNum
|
return Index.endNotice() if pageNum > Index.pagesNum
|
||||||
|
|
||||||
threadIDs = Index.threadsOnPage pageNum
|
threadIDs = Index.threadsOnPage pageNum
|
||||||
threads = Index.buildThreads threadIDs
|
Index.buildStructure threadIDs
|
||||||
Index.buildStructure threads
|
|
||||||
|
|
||||||
endNotice: do ->
|
endNotice: do ->
|
||||||
notify = false
|
notify = false
|
||||||
@ -767,21 +766,21 @@ Index =
|
|||||||
threadIDs = Index.sortedThreadIDs.filter (ID) -> !Index.isHidden(ID) isnt Index.showHiddenThreads
|
threadIDs = Index.sortedThreadIDs.filter (ID) -> !Index.isHidden(ID) isnt Index.showHiddenThreads
|
||||||
else
|
else
|
||||||
threadIDs = Index.threadsOnPage Index.currentPage
|
threadIDs = Index.threadsOnPage Index.currentPage
|
||||||
threads = Index.buildThreads threadIDs
|
|
||||||
delete Index.pageNum
|
delete Index.pageNum
|
||||||
$.rmAll Index.root
|
$.rmAll Index.root
|
||||||
$.rmAll Header.hover
|
$.rmAll Header.hover
|
||||||
if Conf['Index Mode'] is 'catalog'
|
if Conf['Index Mode'] is 'catalog'
|
||||||
Index.buildCatalog threads
|
Index.buildCatalog threadIDs
|
||||||
else
|
else
|
||||||
Index.buildStructure threads
|
Index.buildStructure threadIDs
|
||||||
|
|
||||||
threadsOnPage: (pageNum) ->
|
threadsOnPage: (pageNum) ->
|
||||||
nodesPerPage = Index.threadsNumPerPage
|
nodesPerPage = Index.threadsNumPerPage
|
||||||
offset = nodesPerPage * (pageNum - 1)
|
offset = nodesPerPage * (pageNum - 1)
|
||||||
Index.sortedThreadIDs[offset ... offset + nodesPerPage]
|
Index.sortedThreadIDs[offset ... offset + nodesPerPage]
|
||||||
|
|
||||||
buildStructure: (threads) ->
|
buildStructure: (threadIDs) ->
|
||||||
|
threads = Index.buildThreads threadIDs
|
||||||
Index.buildReplies threads if Conf['Show Replies']
|
Index.buildReplies threads if Conf['Show Replies']
|
||||||
nodes = []
|
nodes = []
|
||||||
for thread in threads
|
for thread in threads
|
||||||
@ -794,7 +793,8 @@ Index =
|
|||||||
if doc.contains Index.root
|
if doc.contains Index.root
|
||||||
$.event 'PostsInserted'
|
$.event 'PostsInserted'
|
||||||
|
|
||||||
buildCatalog: (threads) ->
|
buildCatalog: (threadIDs) ->
|
||||||
|
threads = Index.buildThreads threadIDs
|
||||||
Index.buildCatalogViews threads
|
Index.buildCatalogViews threads
|
||||||
Index.sizeCatalogViews threads
|
Index.sizeCatalogViews threads
|
||||||
Index.buildCatalogReplies threads if Conf['Show Replies'] and Conf['Catalog Hover Expand']
|
Index.buildCatalogReplies threads if Conf['Show Replies'] and Conf['Catalog Hover Expand']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user