Fix thread watcher/expansion/hiding buttons after an index refresh.
This commit is contained in:
parent
43567173fc
commit
11c3b0018a
@ -2,6 +2,8 @@ ExpandThread =
|
||||
init: ->
|
||||
return if g.VIEW isnt 'index' or !Conf['Thread Expansion']
|
||||
|
||||
$.on d, 'IndexRefresh', @onrefresh
|
||||
|
||||
Thread.callbacks.push
|
||||
name: 'Thread Expansion'
|
||||
cb: @node
|
||||
@ -15,6 +17,11 @@ ExpandThread =
|
||||
$.on a, 'click', ExpandThread.cbToggle
|
||||
$.replace span, a
|
||||
|
||||
onrefresh: ->
|
||||
for threadID, thread of g.BOARD.threads
|
||||
ExpandThread.node.call thread
|
||||
return
|
||||
|
||||
text: (status, posts, files) ->
|
||||
text = [status]
|
||||
text.push "#{posts} post#{if posts > 1 then 's' else ''}"
|
||||
|
||||
@ -83,7 +83,7 @@ Index =
|
||||
nodes.push threadRoot, $.el 'hr'
|
||||
unless thread = g.threads["#{g.BOARD}.#{data.no}"]
|
||||
thread = new Thread data.no, g.BOARD
|
||||
threads.push thread
|
||||
threads.push thread
|
||||
for postRoot in $$ '.thread > .postContainer', threadRoot
|
||||
continue if thread.posts[postRoot.id.match /\d+/]
|
||||
try
|
||||
@ -104,3 +104,4 @@ Index =
|
||||
$.rmAll board
|
||||
$.add board, nodes
|
||||
$('.pagelist').hidden = Conf['Index Mode'] isnt 'paged'
|
||||
$.event 'IndexRefresh'
|
||||
|
||||
@ -12,6 +12,7 @@ ThreadWatcher =
|
||||
$.on d, 'QRPostSuccessful', @cb.post
|
||||
$.on d, 'ThreadUpdate', @cb.threadUpdate if g.VIEW is 'thread'
|
||||
$.on d, '4chanXInitFinished', @ready
|
||||
$.on d, 'IndexRefresh', @refresh
|
||||
|
||||
now = Date.now()
|
||||
if (@db.data.lastChecked or 0) < now - 2 * $.HOUR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user