diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 189a0a697..e78f7747c 100755 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -4,7 +4,6 @@ ThreadHiding = @db = new DataBoard 'hiddenThreads' @syncCatalog() - $.on d, 'IndexBuild', @onIndexBuild Thread.callbacks.push name: 'Thread Hiding' cb: @node @@ -15,12 +14,10 @@ ThreadHiding = return unless Conf['Thread Hiding Buttons'] $.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide' - onIndexBuild: ({detail: nodes}) -> - for root, i in nodes by 2 + onIndexBuild: (nodes) -> + for root in nodes thread = Get.threadFromRoot root - continue unless thread.isHidden - if thread.stub and !root.contains thread.stub - # When we come back to a page, the stub is already there. + if thread.isHidden and thread.stub and !root.contains thread.stub ThreadHiding.makeStub thread, root return diff --git a/src/General/Index.coffee b/src/General/Index.coffee index f59b45c75..e37339d89 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -438,11 +438,9 @@ Index = nodes buildStructure: (nodes) -> - result = $.frag() - i = 0 - $.add result, [node, $.el 'hr'] while node = nodes[i++] - $.event 'IndexBuild', result.children - $.add Index.root, result + for node in nodes + $.add Index.root, [node, $.el 'hr'] + ThreadHiding.onIndexBuild nodes isSearching: false