Fix delay in custom CSS loading.

This commit is contained in:
ccd0 2015-11-22 03:19:17 -08:00
parent bd1babd898
commit e103f0bcfb
2 changed files with 3 additions and 3 deletions

View File

@ -134,11 +134,11 @@ $.onExists = (root, selector, subtree, cb) ->
cb el
observer.observe root, {childList: true, subtree}
$.addStyle = (css, id, test) ->
$.addStyle = (css, id, test='head') ->
style = $.el 'style',
textContent: css
style.id = id if id?
$.asap (-> d.head and (!test? or test())), ->
$.onExists doc, test, true, ->
$.add d.head, style
style

View File

@ -4,7 +4,7 @@ CustomCSS =
@addStyle()
addStyle: ->
@style = $.addStyle Conf['usercss'], 'custom-css', -> $.id 'fourchanx-css'
@style = $.addStyle Conf['usercss'], 'custom-css', '#fourchanx-css'
rmStyle: ->
if @style