Revert "don't wait for 4chanMainInit before adding CSS"
This reverts commit 77af50b6c9afa200e6b3484393928632db3760c4.
This commit is contained in:
parent
450910789d
commit
e330426d9b
@ -17,8 +17,6 @@ Main =
|
||||
if g.VIEW is 'thread'
|
||||
g.THREADID = +pathname[3]
|
||||
|
||||
Main.initStyle()
|
||||
|
||||
# flatten Config into Conf
|
||||
# and get saved or default values
|
||||
flatten = (parent, obj) ->
|
||||
@ -38,6 +36,8 @@ Main =
|
||||
$.extend Conf, items
|
||||
Main.initFeatures()
|
||||
|
||||
$.on d, '4chanMainInit', Main.initStyle
|
||||
|
||||
initFeatures: ->
|
||||
switch location.hostname
|
||||
when 'a.4cdn.org'
|
||||
@ -83,7 +83,8 @@ Main =
|
||||
$.ready Main.initReady
|
||||
|
||||
initStyle: ->
|
||||
return if !Main.isThisPageLegit()
|
||||
$.off d, '4chanMainInit', Main.initStyle
|
||||
return if !Main.isThisPageLegit() or $.hasClass doc, 'fourchan-x'
|
||||
# disable the mobile layout
|
||||
$('link[href*=mobile]', d.head)?.disabled = true
|
||||
$.addClass doc, 'fourchan-x', 'seaweedchan'
|
||||
@ -91,13 +92,9 @@ Main =
|
||||
$.addClass doc, if chrome? then 'blink' else 'gecko'
|
||||
$.addStyle Main.css
|
||||
|
||||
$.on d, '4chanMainInit', Main.setClass
|
||||
Main.setClass()
|
||||
|
||||
setClass: ->
|
||||
$.off d, '4chanMainInit', Main.setClass
|
||||
return if Main.setClassRun or !Main.isThisPageLegit()
|
||||
Main.setClassRun = true
|
||||
|
||||
if g.VIEW is 'catalog'
|
||||
$.addClass doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace /_+/g, '-'
|
||||
return
|
||||
@ -129,7 +126,7 @@ Main =
|
||||
return
|
||||
|
||||
# Something might have gone wrong!
|
||||
Main.setClass()
|
||||
Main.initStyle()
|
||||
|
||||
# 4chan Pass Link
|
||||
if styleSelector = $.id 'styleSelector'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user