Custom CSS should always be added after main CSS.

Also fix issue with "undefined" IDs.
This commit is contained in:
ccd0 2014-10-25 19:32:16 -07:00
parent 29d7e35840
commit ea3c4d9bc6
2 changed files with 4 additions and 3 deletions

View File

@ -90,7 +90,7 @@ Main =
$.addClass doc, 'fourchan-x', 'seaweedchan'
$.addClass doc, if g.VIEW is 'thread' then 'thread-view' else g.VIEW
$.addClass doc, if chrome? then 'blink' else 'gecko'
$.addStyle Main.css
$.addStyle Main.css, 'fourchanx-css'
Main.setClass()

View File

@ -3,7 +3,8 @@ CustomCSS =
return unless Conf['Custom CSS']
@addStyle()
addStyle: ->
@style = $.addStyle Conf['usercss']
$.asap (-> $.id 'fourchanx-css'), =>
@style = $.addStyle Conf['usercss'], 'custom-css'
rmStyle: ->
if @style
$.rm @style
@ -11,4 +12,4 @@ CustomCSS =
update: ->
unless @style
@addStyle()
@style.textContent = Conf['usercss']
@style.textContent = Conf['usercss']