[FIX] IE9 - Catch error when we try to load a new stylesheet but that we have already reached the max number of sheet in IE9 : 31

bzr revid: jke@openerp.com-20140325172147-6ymq1ixebawj4ce2
This commit is contained in:
Kersten Jeremy 2014-03-25 18:21:47 +01:00
parent e61d12bfa7
commit 062ee7485c
1 changed files with 5 additions and 1 deletions

View File

@ -582,7 +582,11 @@
var tag;
//if ('\v' == 'v') /* ie only */ {
if (document.createStyleSheet) {
document.createStyleSheet().cssText = css;
try {
document.createStyleSheet().cssText = css;
} catch(err) {
console.log('Failed - IE9 limit 31 sheets CSS');
}
} else {
tag = document.createElement('style');
tag.type = 'text/css';