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
|
cb el
|
||||||
observer.observe root, {childList: true, subtree}
|
observer.observe root, {childList: true, subtree}
|
||||||
|
|
||||||
$.addStyle = (css, id, test) ->
|
$.addStyle = (css, id, test='head') ->
|
||||||
style = $.el 'style',
|
style = $.el 'style',
|
||||||
textContent: css
|
textContent: css
|
||||||
style.id = id if id?
|
style.id = id if id?
|
||||||
$.asap (-> d.head and (!test? or test())), ->
|
$.onExists doc, test, true, ->
|
||||||
$.add d.head, style
|
$.add d.head, style
|
||||||
style
|
style
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ CustomCSS =
|
|||||||
@addStyle()
|
@addStyle()
|
||||||
|
|
||||||
addStyle: ->
|
addStyle: ->
|
||||||
@style = $.addStyle Conf['usercss'], 'custom-css', -> $.id 'fourchanx-css'
|
@style = $.addStyle Conf['usercss'], 'custom-css', '#fourchanx-css'
|
||||||
|
|
||||||
rmStyle: ->
|
rmStyle: ->
|
||||||
if @style
|
if @style
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user