From ea3c4d9bc6295c69116718309ecebf0e073ae76a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 25 Oct 2014 19:32:16 -0700 Subject: [PATCH] Custom CSS should always be added after main CSS. Also fix issue with "undefined" IDs. --- src/General/Main.coffee | 2 +- src/Miscellaneous/CustomCSS.coffee | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 8d01f2e0f..0c195804e 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -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() diff --git a/src/Miscellaneous/CustomCSS.coffee b/src/Miscellaneous/CustomCSS.coffee index a990ed7bd..46627c2e6 100755 --- a/src/Miscellaneous/CustomCSS.coffee +++ b/src/Miscellaneous/CustomCSS.coffee @@ -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'] \ No newline at end of file + @style.textContent = Conf['usercss']