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' @db = new DataBoard 'hiddenThreads'
@syncCatalog() @syncCatalog()
$.on d, 'IndexBuild', @onIndexBuild
Thread.callbacks.push Thread.callbacks.push
name: 'Thread Hiding' name: 'Thread Hiding'
cb: @node cb: @node
@ -15,12 +14,10 @@ ThreadHiding =
return unless Conf['Thread Hiding Buttons'] return unless Conf['Thread Hiding Buttons']
$.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide' $.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide'
onIndexBuild: ({detail: nodes}) -> onIndexBuild: (nodes) ->
for root, i in nodes by 2 for root in nodes
thread = Get.threadFromRoot root thread = Get.threadFromRoot root
continue unless thread.isHidden if thread.isHidden and thread.stub and !root.contains thread.stub
if thread.stub and !root.contains thread.stub
# When we come back to a page, the stub is already there.
ThreadHiding.makeStub thread, root ThreadHiding.makeStub thread, root
return return

View File

@ -438,11 +438,9 @@ Index =
nodes nodes
buildStructure: (nodes) -> buildStructure: (nodes) ->
result = $.frag() for node in nodes
i = 0 $.add Index.root, [node, $.el 'hr']
$.add result, [node, $.el 'hr'] while node = nodes[i++] ThreadHiding.onIndexBuild nodes
$.event 'IndexBuild', result.children
$.add Index.root, result
isSearching: false isSearching: false