remove IndexBuild event

This commit is contained in:
ccd0 2014-06-18 01:53:18 -07:00
parent cec3479ab3
commit 5ad30ead3f
2 changed files with 6 additions and 11 deletions

View File

@ -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

View File

@ -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