diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2014-02-25 18:34:25 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2014-03-01 16:26:03 -0800 |
| commit | b8988e1d3ac75af63c85e8563e57701030315a9e (patch) | |
| tree | db1eb8de0d989314c493de16f1a480cacb0dd57f /rt/share/html/Admin/Tools/Theme.html | |
| parent | 7f029e082712dceafb9152820746da79a50f2275 (diff) | |
RT 4.0.19
Diffstat (limited to 'rt/share/html/Admin/Tools/Theme.html')
| -rw-r--r-- | rt/share/html/Admin/Tools/Theme.html | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/rt/share/html/Admin/Tools/Theme.html b/rt/share/html/Admin/Tools/Theme.html index a3f910edb..ac297e9ee 100644 --- a/rt/share/html/Admin/Tools/Theme.html +++ b/rt/share/html/Admin/Tools/Theme.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -131,14 +131,24 @@ jQuery(function($) { .text(v[0])); }); - $("style#sitecss").text($('#user_css').val()); + function update_sitecss(text) { + if (!text) + text = $('#user_css').val(); + + // IE 8 doesn't let us update the innerHTML of <style> tags (with jQuery.text()) + // see: http://stackoverflow.com/questions/2692770/style-style-textcss-appendtohead-does-not-work-in-ie/2692861#2692861 + $("style#sitecss").remove(); + $("<style id='sitecss' type='text/css' media='all'>" + text + "</style>").appendTo('head'); + } + + update_sitecss(); $('#try').click(function() { - $("style#sitecss").text($('#user_css').val()); + update_sitecss(); }); $('#reset').click(function() { setTimeout(function() { - $("style#sitecss").text($('#user_css').val()); + update_sitecss(); }, 1000); }); @@ -174,7 +184,7 @@ jQuery(function($) { } } $('#user_css').val(css); - $("style#sitecss").text(css); + update_sitecss(css); } $('#color-picker').farbtastic(function(color){ change_color(color, this.hsl[2] > <% $text_threshold %> ? '#000' : '#fff') }); |
