From 1aff1f87e7f3debde343e605b4be394f854b4314 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 17 Sep 2016 21:37:09 -0700 Subject: [PATCH] Turn this into a loop over threads. --- src/General/Index.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 572f78351..c2542f501 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -715,13 +715,12 @@ Index = Index.sortedThreads[offset ... offset + nodesPerPage] buildStructure: (threads) -> - nodes = threads.map (thread) -> Index.nodes[thread.ID] - for node in nodes - if thumb = $ 'img[data-src]', node + for thread in threads + if (file = thread.OP.file) and (thumb = thread.OP.file.thumb) and thumb.dataset.src thumb.src = thumb.dataset.src # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 thumb.removeAttribute 'data-src' - $.add Index.root, [node, $.el 'hr'] + $.add Index.root, [Index.nodes[thread.ID], $.el 'hr'] if doc.contains Index.root $.event 'PostsInserted' $.event 'IndexBuild'