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