Small CustomCSS optimization

This commit is contained in:
Zixaphir 2014-02-23 08:33:31 -07:00
parent 8fa130c2df
commit 58a3adeedb
3 changed files with 6 additions and 3 deletions

View File

@ -10776,7 +10776,7 @@
}, },
update: function() { update: function() {
if (!this.style) { if (!this.style) {
this.addStyle(); return this.addStyle();
} }
return this.style.textContent = Conf['usercss']; return this.style.textContent = Conf['usercss'];
} }

View File

@ -10773,7 +10773,7 @@
}, },
update: function() { update: function() {
if (!this.style) { if (!this.style) {
this.addStyle(); return this.addStyle();
} }
return this.style.textContent = Conf['usercss']; return this.style.textContent = Conf['usercss'];
} }

View File

@ -2,13 +2,16 @@ CustomCSS =
init: -> init: ->
return unless Conf['Custom CSS'] return unless Conf['Custom CSS']
@addStyle() @addStyle()
addStyle: -> addStyle: ->
@style = $.addStyle Conf['usercss'] @style = $.addStyle Conf['usercss']
rmStyle: -> rmStyle: ->
if @style if @style
$.rm @style $.rm @style
delete @style delete @style
update: -> update: ->
unless @style unless @style
@addStyle() return @addStyle()
@style.textContent = Conf['usercss'] @style.textContent = Conf['usercss']