From 58a3adeedbad9cb01c31e7169f61b848e5fc72fd Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 23 Feb 2014 08:33:31 -0700 Subject: [PATCH] Small CustomCSS optimization --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/Miscellaneous/CustomCSS.coffee | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 9615fc049..33133ff35 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -10776,7 +10776,7 @@ }, update: function() { if (!this.style) { - this.addStyle(); + return this.addStyle(); } return this.style.textContent = Conf['usercss']; } diff --git a/builds/crx/script.js b/builds/crx/script.js index f6bac2241..39c9da9a0 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -10773,7 +10773,7 @@ }, update: function() { if (!this.style) { - this.addStyle(); + return this.addStyle(); } return this.style.textContent = Conf['usercss']; } diff --git a/src/Miscellaneous/CustomCSS.coffee b/src/Miscellaneous/CustomCSS.coffee index a990ed7bd..f36b20200 100755 --- a/src/Miscellaneous/CustomCSS.coffee +++ b/src/Miscellaneous/CustomCSS.coffee @@ -2,13 +2,16 @@ CustomCSS = init: -> return unless Conf['Custom CSS'] @addStyle() + addStyle: -> @style = $.addStyle Conf['usercss'] + rmStyle: -> if @style $.rm @style delete @style + update: -> unless @style - @addStyle() + return @addStyle() @style.textContent = Conf['usercss'] \ No newline at end of file