From 2a7113ebdf22b7d9c9ad0d10744b31554c7da2a8 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 12 Jan 2014 15:01:30 -0700 Subject: [PATCH] Hide a harmless console error during rush conditions --- builds/appchan-x.user.js | 3 +++ builds/crx/script.js | 3 +++ src/Theming/Mascots.coffee | 1 + 3 files changed, 7 insertions(+) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index dc0cb40ec..81a488920 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -13371,6 +13371,9 @@ }, reposition: function() { var mascot; + if (!Style.mascot) { + return; + } mascot = Mascots[Conf['mascot']]; return Style.mascot.textContent = "#mascot img {\nheight: " + (mascot.height && isNaN(parseFloat(mascot.height)) ? mascot.height : mascot.height ? parseInt(mascot.height, 10) + 'px' : 'auto') + ";\nwidth: " + (mascot.width && isNaN(parseFloat(mascot.width)) ? mascot.width : mascot.width ? parseInt(mascot.width, 10) + 'px' : 'auto') + ";\n}\n#mascot {\nmargin: " + (mascot.vOffset || 0) + "px " + (mascot.hOffset || 0) + "px;\n}\n.sidebar-large #mascot {\nleft: " + (mascot.center ? 25 : 0) + "px;\nright: " + (mascot.center ? 25 : 0) + "px;\n}\n.mascot-position-above-post-form.post-form-style-fixed #mascot {\ntransform: translateY(-" + (QR.nodes ? QR.nodes.el.getBoundingClientRect().height : 0) + "px);\n}"; } diff --git a/builds/crx/script.js b/builds/crx/script.js index 7a06ff71a..cc7d08bcc 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -13361,6 +13361,9 @@ }, reposition: function() { var mascot; + if (!Style.mascot) { + return; + } mascot = Mascots[Conf['mascot']]; return Style.mascot.textContent = "#mascot img {\nheight: " + (mascot.height && isNaN(parseFloat(mascot.height)) ? mascot.height : mascot.height ? parseInt(mascot.height, 10) + 'px' : 'auto') + ";\nwidth: " + (mascot.width && isNaN(parseFloat(mascot.width)) ? mascot.width : mascot.width ? parseInt(mascot.width, 10) + 'px' : 'auto') + ";\n}\n#mascot {\nmargin: " + (mascot.vOffset || 0) + "px " + (mascot.hOffset || 0) + "px;\n}\n.sidebar-large #mascot {\nleft: " + (mascot.center ? 25 : 0) + "px;\nright: " + (mascot.center ? 25 : 0) + "px;\n}\n.mascot-position-above-post-form.post-form-style-fixed #mascot {\n-webkit-transform: translateY(-" + (QR.nodes ? QR.nodes.el.getBoundingClientRect().height : 0) + "px);\n}"; } diff --git a/src/Theming/Mascots.coffee b/src/Theming/Mascots.coffee index 096284c86..0b9a88f2b 100644 --- a/src/Theming/Mascots.coffee +++ b/src/Theming/Mascots.coffee @@ -365,5 +365,6 @@ MascotTools = reader.readAsText file reposition: -> + return unless Style.mascot mascot = Mascots[Conf['mascot']] Style.mascot.textContent = """<%= grunt.file.read('src/General/css/mascot.css') %>""" \ No newline at end of file