Turn this into a loop over threads.

This commit is contained in:
ccd0 2016-09-17 21:37:09 -07:00
parent 3f63be3cec
commit 1aff1f87e7

View File

@ -715,13 +715,12 @@ Index =
Index.sortedThreads[offset ... offset + nodesPerPage] Index.sortedThreads[offset ... offset + nodesPerPage]
buildStructure: (threads) -> buildStructure: (threads) ->
nodes = threads.map (thread) -> Index.nodes[thread.ID] for thread in threads
for node in nodes if (file = thread.OP.file) and (thumb = thread.OP.file.thumb) and thumb.dataset.src
if thumb = $ 'img[data-src]', node
thumb.src = thumb.dataset.src thumb.src = thumb.dataset.src
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289
thumb.removeAttribute 'data-src' thumb.removeAttribute 'data-src'
$.add Index.root, [node, $.el 'hr'] $.add Index.root, [Index.nodes[thread.ID], $.el 'hr']
if doc.contains Index.root if doc.contains Index.root
$.event 'PostsInserted' $.event 'PostsInserted'
$.event 'IndexBuild' $.event 'IndexBuild'