use $.asap instead of specializing $.ready
This commit is contained in:
parent
dfbec95dab
commit
27558ba6d6
@ -50,7 +50,7 @@ Main =
|
|||||||
Report.init()
|
Report.init()
|
||||||
return
|
return
|
||||||
when 'i.4cdn.org'
|
when 'i.4cdn.org'
|
||||||
onReady = ->
|
$.asap (-> d.readyState isnt 'loading'), ->
|
||||||
if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
|
if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
|
||||||
Redirect.init()
|
Redirect.init()
|
||||||
pathname = location.pathname.split '/'
|
pathname = location.pathname.split '/'
|
||||||
@ -63,7 +63,6 @@ Main =
|
|||||||
$.on video, 'click', ->
|
$.on video, 'click', ->
|
||||||
if !video.controls
|
if !video.controls
|
||||||
if video.paused then video.play() else video.pause()
|
if video.paused then video.play() else video.pause()
|
||||||
$.ready onReady, true
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# c.time 'All initializations'
|
# c.time 'All initializations'
|
||||||
|
|||||||
@ -16,9 +16,9 @@ $.DAY = 24 *
|
|||||||
$.id = (id) ->
|
$.id = (id) ->
|
||||||
d.getElementById id
|
d.getElementById id
|
||||||
|
|
||||||
$.ready = (fc, immediate) ->
|
$.ready = (fc) ->
|
||||||
unless d.readyState is 'loading'
|
unless d.readyState is 'loading'
|
||||||
if immediate then fc() else $.queueTask fc
|
$.queueTask fc
|
||||||
return
|
return
|
||||||
cb = ->
|
cb = ->
|
||||||
$.off d, 'DOMContentLoaded', cb
|
$.off d, 'DOMContentLoaded', cb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user