Load the index asap on page load.

This commit is contained in:
Mayhem 2013-11-01 04:04:34 +01:00
parent 29b96a4a07
commit 5b6c1df083
3 changed files with 11 additions and 6 deletions

View File

@ -362,6 +362,11 @@ a[href="javascript:;"] {
overflow: hidden; overflow: hidden;
} }
/* Index */
:root.index-loading .board {
display: none;
}
/* Announcement Hiding */ /* Announcement Hiding */
:root.hide-announcement #globalMessage, :root.hide-announcement #globalMessage,
:root.hide-announcement-enabled #toggleMsgBtn { :root.hide-announcement-enabled #toggleMsgBtn {

View File

@ -69,7 +69,7 @@ Main =
initFeature 'Polyfill', Polyfill initFeature 'Polyfill', Polyfill
initFeature 'Header', Header initFeature 'Header', Header
initFeature 'Settings', Settings initFeature 'Settings', Settings
initFeature 'Index Pager', Index initFeature 'Index Generator', Index
initFeature 'Announcement Hiding', PSAHiding initFeature 'Announcement Hiding', PSAHiding
initFeature 'Fourchan thingies', Fourchan initFeature 'Fourchan thingies', Fourchan
initFeature 'Custom CSS', CustomCSS initFeature 'Custom CSS', CustomCSS

View File

@ -40,12 +40,12 @@ Index =
order: 90 order: 90
subEntries: [modeEntry, sortEntry] subEntries: [modeEntry, sortEntry]
$.on d, '4chanXInitFinished', @initReady $.addClass doc, 'index-loading'
Index.root = $.el 'div', className: 'board'
initReady: ->
$.off d, '4chanXInitFinished', Index.initReady
Index.root = $ '.board'
Index.update() Index.update()
$.asap (-> $('.board', doc) or d.readyState isnt 'loading'), ->
$.replace $('.board'), Index.root
$.rmClass doc, 'index-loading'
cb: cb:
mode: -> mode: ->