From bd8bbfff2a076b888a3c46d560bcbe80cb373dc2 Mon Sep 17 00:00:00 2001 From: lpyt Date: Thu, 29 Sep 2016 12:57:41 +0800 Subject: [PATCH 1/2] fixed ie8 not support --- src/gridstack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index 3b5a660b6..2978901e6 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -61,7 +61,7 @@ style.appendChild(document.createTextNode('')); } document.getElementsByTagName('head')[0].appendChild(style); - return style.sheet; + return style.sheet || style.styleSheet; }, removeStylesheet: function(id) { @@ -71,7 +71,7 @@ insertCSSRule: function(sheet, selector, rules, index) { if (typeof sheet.insertRule === 'function') { sheet.insertRule(selector + '{' + rules + '}', index); - } else if (typeof sheet.addRule === 'function') { + } else if (sheet.addRule) { sheet.addRule(selector, rules, index); } }, From 9007eeafe7a8ee104ed351a6fb315cb0614792a3 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Mon, 3 Oct 2016 13:39:39 -0700 Subject: [PATCH 2/2] Revert "fixed ie8 not support" --- src/gridstack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gridstack.js b/src/gridstack.js index 2978901e6..3b5a660b6 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -61,7 +61,7 @@ style.appendChild(document.createTextNode('')); } document.getElementsByTagName('head')[0].appendChild(style); - return style.sheet || style.styleSheet; + return style.sheet; }, removeStylesheet: function(id) { @@ -71,7 +71,7 @@ insertCSSRule: function(sheet, selector, rules, index) { if (typeof sheet.insertRule === 'function') { sheet.insertRule(selector + '{' + rules + '}', index); - } else if (sheet.addRule) { + } else if (typeof sheet.addRule === 'function') { sheet.addRule(selector, rules, index); } },