mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Apply stylesheets client-side in a safer manner.
This commit is contained in:
@@ -667,8 +667,10 @@ $.apply_stylesheet = function(cssText) {
|
||||
* that has the old stylesheet, and delete it. Then we add a
|
||||
* <style> with the new one */
|
||||
$("head").children('*[title="' + sheet_title + '"]').remove();
|
||||
$("head").append("<style type='text/css' media='screen' title='" +
|
||||
sheet_title + "'>" + cssText + "</style>");
|
||||
var stylesheet = $('<style type="text/css" media="screen"></style>')
|
||||
.attr('title', sheet_title)
|
||||
.text(cssText)
|
||||
.appendTo('head')
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user