ThreadWatcher: Move parsing code out of anonymous function.
This commit is contained in:
parent
c6fcbf5de1
commit
f4ee994bf7
@ -159,7 +159,8 @@ ThreadWatcher =
|
||||
for thread in threads
|
||||
ThreadWatcher.fetchStatus thread
|
||||
return
|
||||
fetchStatus: ({boardID, threadID, data}) ->
|
||||
fetchStatus: (thread) ->
|
||||
{boardID, threadID, data} = thread
|
||||
return if data.isDead and !Conf['Show Unread Count']
|
||||
{fetchCount} = ThreadWatcher
|
||||
if fetchCount.fetching is 0
|
||||
@ -168,6 +169,9 @@ ThreadWatcher =
|
||||
fetchCount.fetching++
|
||||
$.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
|
||||
onloadend: ->
|
||||
ThreadWatcher.parseStatus.call @, thread
|
||||
parseStatus: ({boardID, threadID, data}) ->
|
||||
{fetchCount} = ThreadWatcher
|
||||
fetchCount.fetched++
|
||||
if fetchCount.fetched is fetchCount.fetching
|
||||
fetchCount.fetched = 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user