less element (sheet) might not be located in head

This commit is contained in:
Rok Garbas
2012-12-11 04:38:33 +01:00
parent d47668f4a2
commit abb6b999c6

View File

@@ -211,7 +211,7 @@ function createCSS(styles, sheet, lastModified) {
if( sheet.media ){ css.media = sheet.media; }
css.id = id;
var nextEl = sheet && sheet.nextSibling || null;
document.getElementsByTagName('head')[0].insertBefore(css, nextEl);
nextEl.parentNode.insertBefore(css, nextEl);
}
if (css.styleSheet) { // IE