diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 304371de2..79e662e16 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -11988,7 +11988,7 @@ mainStyleSheet = $('link[title=switch]', d.head); newStyleSheet = $("link[title='" + style + "']", d.head); mainStyleSheet.href = newStyleSheet.href; - return Main.initStyle(); + return Main.setClass(); }; fullBoardList = $('#full-board-list', Header.boardList); $.rmClass($('.current', fullBoardList), 'current'); @@ -12880,7 +12880,7 @@ return $.ready(Main.initReady); }, initStyle: function() { - var mainStyleSheet, setStyle, style, styleSheets, _ref; + var _ref; $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -12893,6 +12893,10 @@ $.addClass(doc, 'seaweedchan'); $.addClass(doc, g.VIEW); $.addStyle(Main.css); + return Main.setClass(); + }, + setClass: function() { + var mainStyleSheet, setStyle, style, styleSheets; if (g.VIEW === 'catalog') { $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-')); return; diff --git a/builds/crx/script.js b/builds/crx/script.js index cdfa96886..fc8bd48cc 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11977,7 +11977,7 @@ mainStyleSheet = $('link[title=switch]', d.head); newStyleSheet = $("link[title='" + style + "']", d.head); mainStyleSheet.href = newStyleSheet.href; - return Main.initStyle(); + return Main.setClass(); }; fullBoardList = $('#full-board-list', Header.boardList); $.rmClass($('.current', fullBoardList), 'current'); @@ -12869,7 +12869,7 @@ return $.ready(Main.initReady); }, initStyle: function() { - var mainStyleSheet, setStyle, style, styleSheets, _ref; + var _ref; $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -12882,6 +12882,10 @@ $.addClass(doc, 'seaweedchan'); $.addClass(doc, g.VIEW); $.addStyle(Main.css); + return Main.setClass(); + }, + setClass: function() { + var mainStyleSheet, setStyle, style, styleSheets; if (g.VIEW === 'catalog') { $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-')); return; diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 85760c80c..4caf10189 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -84,7 +84,10 @@ Main = $.addClass doc, 'seaweedchan' $.addClass doc, g.VIEW $.addStyle Main.css + + Main.setClass() + setClass: -> if g.VIEW is 'catalog' $.addClass doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace /_+/g, '-' return diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 7672ae4e8..85e0b306d 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -151,7 +151,7 @@ Navigate = mainStyleSheet.href = newStyleSheet.href - Main.initStyle() + Main.setClass() fullBoardList = $ '#full-board-list', Header.boardList $.rmClass $('.current', fullBoardList), 'current'