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;
}
/* Index */
:root.index-loading .board {
display: none;
}
/* Announcement Hiding */
:root.hide-announcement #globalMessage,
:root.hide-announcement-enabled #toggleMsgBtn {

View File

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

View File

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