simplification

This commit is contained in:
Rachel Fenichel
2016-11-09 13:12:18 -08:00
parent d91ba9e2f9
commit 34a6d5e6e4

View File

@@ -86,11 +86,7 @@ Blockly.Css.inject = function(hasCss, pathToMedia) {
text = text.replace(/<<<PATH>>>/g, Blockly.Css.mediaPath_);
// Inject CSS tag at start of head.
var cssNode = document.createElement('style');
if (document.head.firstChild) {
document.head.insertBefore(cssNode, document.head.firstChild);
} else {
document.head.appendChild(cssNode);
}
document.head.insertBefore(cssNode, document.head.firstChild);
var cssTextNode = document.createTextNode(text);
cssNode.appendChild(cssTextNode);