# HG changeset patch # User Adrien Di Mascio # Date 1337683278 -7200 # Node ID 09432a572a44c23fd188f13a2dbce87dd60c26b6 # Parent 9ac2400cdf8276a82265908d6e851d2aa3789140 [IE] use document.createStyleSheet to add CSS dynamically (closes #2356261) diff -r 9ac2400cdf82 -r 09432a572a44 web/data/cubicweb.ajax.js --- a/web/data/cubicweb.ajax.js Mon May 21 14:17:09 2012 +0200 +++ b/web/data/cubicweb.ajax.js Tue May 22 12:41:18 2012 +0200 @@ -181,8 +181,17 @@ // compute concat-like url for missing resources and append // element to $head if (missingStylesheetsUrl) { - $srcnode.attr('href', missingStylesheetsUrl); - $srcnode.appendTo($head); + // IE has problems with dynamic CSS insertions. One symptom (among others) + // is a "1 item remaining" message in the status bar. (cf. #2356261) + // document.createStyleSheet needs to be used for this, although it seems + // that IE can't create more than 31 additional stylesheets with + // document.createStyleSheet. + if ($.browser.msie) { + document.createStyleSheet(missingStylesheetsUrl); + } else { + $srcnode.attr('href', missingStylesheetsUrl); + $srcnode.appendTo($head); + } } } });