Remove event from $.cache interface.
This commit is contained in:
parent
496043342f
commit
4c329af6e0
@ -15,8 +15,9 @@ class Fetcher
|
||||
|
||||
@root.textContent = "Loading post No.#{@postID}..."
|
||||
if @threadID
|
||||
$.cache "#{location.protocol}//a.4cdn.org/#{@boardID}/thread/#{@threadID}.json", (e, isCached) =>
|
||||
@fetchedPost e.target, isCached
|
||||
that = @
|
||||
$.cache "#{location.protocol}//a.4cdn.org/#{@boardID}/thread/#{@threadID}.json", ({isCached}) ->
|
||||
that.fetchedPost @, isCached
|
||||
else
|
||||
@archivedPost()
|
||||
|
||||
@ -80,8 +81,9 @@ class Fetcher
|
||||
if isCached
|
||||
api = "#{location.protocol}//a.4cdn.org/#{@boardID}/thread/#{@threadID}.json"
|
||||
$.cleanCache (url) -> url is api
|
||||
$.cache api, (e) =>
|
||||
@fetchedPost e.target, false
|
||||
that = @
|
||||
$.cache api, ->
|
||||
that.fetchedPost @, false
|
||||
return
|
||||
|
||||
# The post can be deleted by the time we check a quote.
|
||||
|
||||
@ -87,7 +87,7 @@ do ->
|
||||
$.cache = (url, cb, options) ->
|
||||
if req = reqs[url]
|
||||
if req.readyState is 4
|
||||
$.queueTask -> cb.call req, req.evt, true
|
||||
$.queueTask -> cb.call req, {isCached: true}
|
||||
else
|
||||
req.callbacks.push cb
|
||||
return req
|
||||
@ -96,10 +96,9 @@ do ->
|
||||
return if not (req = $.ajax url, options)
|
||||
catch err
|
||||
return
|
||||
$.on req, 'load', (e) ->
|
||||
@evt = e
|
||||
$.on req, 'load', ->
|
||||
for cb in @callbacks
|
||||
do (cb) => $.queueTask => cb.call @, e, false
|
||||
do (cb) => $.queueTask => cb.call @, {isCached: false}
|
||||
delete @callbacks
|
||||
$.on req, 'abort error', rm
|
||||
req.callbacks = [cb]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user