Simpler d.readyState usage.

This commit is contained in:
Mayhem 2013-06-22 22:14:49 +02:00
parent 1e592dc24f
commit d154bab227
3 changed files with 3 additions and 3 deletions

View File

@ -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 = ->

View File

@ -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 ->

View File

@ -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) ->