Bring back IndexBuild event.
This commit is contained in:
parent
696d3c37c3
commit
4db8b753a6
@ -4,6 +4,7 @@ ThreadHiding =
|
|||||||
@db = new DataBoard 'hiddenThreads'
|
@db = new DataBoard 'hiddenThreads'
|
||||||
return @catalogWatch() if g.VIEW is 'catalog'
|
return @catalogWatch() if g.VIEW is 'catalog'
|
||||||
@catalogSet g.BOARD
|
@catalogSet g.BOARD
|
||||||
|
$.on d, 'IndexBuild', @onIndexBuild
|
||||||
Callbacks.Post.push
|
Callbacks.Post.push
|
||||||
name: 'Thread Hiding'
|
name: 'Thread Hiding'
|
||||||
cb: @node
|
cb: @node
|
||||||
@ -48,8 +49,8 @@ ThreadHiding =
|
|||||||
return unless Conf['Thread Hiding Buttons']
|
return unless Conf['Thread Hiding Buttons']
|
||||||
$.prepend @nodes.root, ThreadHiding.makeButton(@thread, 'hide')
|
$.prepend @nodes.root, ThreadHiding.makeButton(@thread, 'hide')
|
||||||
|
|
||||||
onIndexBuild: (nodes) ->
|
onIndexBuild: ->
|
||||||
for root in nodes
|
for root in $$ '.board > .thread'
|
||||||
thread = Get.threadFromRoot root
|
thread = Get.threadFromRoot root
|
||||||
if thread.isHidden and thread.stub and !root.contains thread.stub
|
if thread.isHidden and thread.stub and !root.contains thread.stub
|
||||||
ThreadHiding.makeStub thread, root
|
ThreadHiding.makeStub thread, root
|
||||||
|
|||||||
@ -116,7 +116,9 @@ Index =
|
|||||||
|
|
||||||
board = $ '.board'
|
board = $ '.board'
|
||||||
$.replace board, Index.root
|
$.replace board, Index.root
|
||||||
$.event 'PostsInserted'
|
if Index.nodes
|
||||||
|
$.event 'PostsInserted'
|
||||||
|
$.event 'IndexBuild'
|
||||||
# Hacks:
|
# Hacks:
|
||||||
# - When removing an element from the document during page load,
|
# - When removing an element from the document during page load,
|
||||||
# its ancestors will still be correctly created inside of it.
|
# its ancestors will still be correctly created inside of it.
|
||||||
@ -707,6 +709,8 @@ Index =
|
|||||||
nodes = Index.buildCatalogViews()
|
nodes = Index.buildCatalogViews()
|
||||||
Index.sizeCatalogViews nodes
|
Index.sizeCatalogViews nodes
|
||||||
$.add Index.root, nodes
|
$.add Index.root, nodes
|
||||||
|
if doc.contains Index.root
|
||||||
|
$.event 'IndexBuild'
|
||||||
else
|
else
|
||||||
Index.buildReplies threads if Conf['Show Replies']
|
Index.buildReplies threads if Conf['Show Replies']
|
||||||
Index.buildStructure threads
|
Index.buildStructure threads
|
||||||
@ -726,8 +730,9 @@ Index =
|
|||||||
# 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, [node, $.el 'hr']
|
||||||
$.event 'PostsInserted' if doc.contains Index.root
|
if doc.contains Index.root
|
||||||
ThreadHiding.onIndexBuild nodes
|
$.event 'PostsInserted'
|
||||||
|
$.event 'IndexBuild'
|
||||||
|
|
||||||
clearSearch: ->
|
clearSearch: ->
|
||||||
Index.searchInput.value = ''
|
Index.searchInput.value = ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user