Fix delay in custom CSS loading.
This commit is contained in:
parent
bd1babd898
commit
e103f0bcfb
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user