diff --git a/src/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee index fe2305bdc..dbe736305 100644 --- a/src/Miscellaneous/ExpandThread.coffee +++ b/src/Miscellaneous/ExpandThread.coffee @@ -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 ''}" diff --git a/src/Miscellaneous/Index.coffee b/src/Miscellaneous/Index.coffee index b1db097ec..fa717fd68 100644 --- a/src/Miscellaneous/Index.coffee +++ b/src/Miscellaneous/Index.coffee @@ -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' diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 54bfb9435..7697ce4cb 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -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