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
|
for thread in threads
|
||||||
ThreadWatcher.fetchStatus thread
|
ThreadWatcher.fetchStatus thread
|
||||||
return
|
return
|
||||||
fetchStatus: ({boardID, threadID, data}) ->
|
fetchStatus: (thread) ->
|
||||||
|
{boardID, threadID, data} = thread
|
||||||
return if data.isDead and !Conf['Show Unread Count']
|
return if data.isDead and !Conf['Show Unread Count']
|
||||||
{fetchCount} = ThreadWatcher
|
{fetchCount} = ThreadWatcher
|
||||||
if fetchCount.fetching is 0
|
if fetchCount.fetching is 0
|
||||||
@ -168,6 +169,9 @@ ThreadWatcher =
|
|||||||
fetchCount.fetching++
|
fetchCount.fetching++
|
||||||
$.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
|
$.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
|
||||||
onloadend: ->
|
onloadend: ->
|
||||||
|
ThreadWatcher.parseStatus.call @, thread
|
||||||
|
parseStatus: ({boardID, threadID, data}) ->
|
||||||
|
{fetchCount} = ThreadWatcher
|
||||||
fetchCount.fetched++
|
fetchCount.fetched++
|
||||||
if fetchCount.fetched is fetchCount.fetching
|
if fetchCount.fetched is fetchCount.fetching
|
||||||
fetchCount.fetched = 0
|
fetchCount.fetched = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user