Simpler d.readyState usage.
This commit is contained in:
parent
1e592dc24f
commit
d154bab227
@ -13,7 +13,7 @@ $.DAY = 1000 * 60 * 60 * 24
|
||||
$.id = (id) ->
|
||||
d.getElementById id
|
||||
$.ready = (fc) ->
|
||||
if d.readyState in ['interactive', 'complete']
|
||||
unless d.readyState is 'loading'
|
||||
$.queueTask fc
|
||||
return
|
||||
cb = ->
|
||||
|
||||
@ -74,7 +74,7 @@ Header =
|
||||
return unless Main.isThisPageLegit()
|
||||
# Wait for #boardNavMobile instead of #boardNavDesktop,
|
||||
# it might be incomplete otherwise.
|
||||
$.asap (-> $.id('boardNavMobile') or d.readyState in ['interactive', 'complete']), Header.setBoardList
|
||||
$.asap (-> $.id('boardNavMobile') or d.readyState isnt 'loading'), Header.setBoardList
|
||||
$.prepend d.body, headerEl
|
||||
|
||||
$.ready ->
|
||||
|
||||
@ -35,7 +35,7 @@ Main =
|
||||
$.on d, '4chanMainInit', Main.initStyle
|
||||
# <title> comes after the stylesheets on the index/thread pages, but before on the catalog.
|
||||
# <link favicon> comes after the stylesheets on the catalog, but before on the index/thread pages.
|
||||
$.asap (-> d.head and $('title', d.head) and $('link[rel="shortcut icon"]', d.head) or d.readyState in ['interactive', 'complete']),
|
||||
$.asap (-> d.head and $('title', d.head) and $('link[rel="shortcut icon"]', d.head) or d.readyState isnt 'loading'
|
||||
Main.initStyle
|
||||
|
||||
initFeatures: (items) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user