From e4e25d86e3ad865ea4f60eeba4b89c99985cd959 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 12 Mar 2015 00:35:08 -0700 Subject: [PATCH] Oops, bug when lS undefined --- js/options/user-css.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/options/user-css.js b/js/options/user-css.js index 612a9d48..45376fe0 100644 --- a/js/options/user-css.js +++ b/js/options/user-css.js @@ -29,6 +29,9 @@ var submit = $("").css({ onready(function(){ var stylechooser = $("").appendTo(tab.content); + // Handle empty localStorage + if (!localStorage.stylesheets_all_boards) localStorage.stylesheets_all_boards = "false"; + if (!localStorage.board_stylesheets) localStorage.board_stylesheets = '{}'; var fix_choice = function(){ stylechooser.empty(); @@ -48,8 +51,6 @@ onready(function(){ var allboards = $("").appendTo(tab.content).find('input'); - // Handle empty localStorage - if (!localStorage.stylesheets_all_boards) localStorage.stylesheets_all_boards = "false"; if (localStorage.stylesheets_all_boards === "true") allboards.prop('checked', 'checked'); allboards.on('change', function(e) { @@ -106,7 +107,7 @@ var apply_css = function() { ls.after($("") .attr("class", "user-chosen-stylesheet") .attr("id", "stylesheet") - .attr("href", configRoot+to_apply) + .attr("href", (configRoot !== '/' ? configRoot : '')+to_apply) ); } return to_apply;