Eliminate use of onabort and event in Index.coffee.

This commit is contained in:
ccd0 2019-03-08 20:54:41 -08:00
parent a94d76d84b
commit 44feaf4eb7

View File

@ -573,6 +573,7 @@ Index =
"#{hiddenCount} hidden threads" "#{hiddenCount} hidden threads"
update: (firstTime) -> update: (firstTime) ->
Index.req?.aborted = true
Index.req?.abort() Index.req?.abort()
Index.notice?.close() Index.notice?.close()
@ -594,13 +595,12 @@ Index =
return return
Index.req = $.ajax "#{location.protocol}//a.4cdn.org/#{g.BOARD}/catalog.json", Index.req = $.ajax "#{location.protocol}//a.4cdn.org/#{g.BOARD}/catalog.json",
onabort: Index.load
onloadend: Index.load onloadend: Index.load
, ,
whenModified: 'Index' whenModified: 'Index'
$.addClass Index.button, 'fa-spin' $.addClass Index.button, 'fa-spin'
load: (e) -> load: ->
$.rmClass Index.button, 'fa-spin' $.rmClass Index.button, 'fa-spin'
{req, notice, nTimeout} = Index {req, notice, nTimeout} = Index
clearTimeout nTimeout if nTimeout clearTimeout nTimeout if nTimeout
@ -608,7 +608,7 @@ Index =
delete Index.req delete Index.req
delete Index.notice delete Index.notice
if e.type is 'abort' if req.aborted
req.onloadend = null req.onloadend = null
notice?.close() notice?.close()
return return