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