From 548c128cb5a3225a4b9982197aab277e41e8a7e6 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Thu, 26 Feb 2015 21:52:50 -0800 Subject: [PATCH] update gridstack.js --- gridstack.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gridstack.js b/gridstack.js index b9b5208..3f293f2 100644 --- a/gridstack.js +++ b/gridstack.js @@ -33,10 +33,10 @@ }, insert_css_rule: function (sheet, selector, rules, index) { - if("insertRule" in sheet) { + if(typeof sheet.insertRule === 'function') { sheet.insertRule(selector + "{" + rules + "}", index); } - else if("addRule" in sheet) { + else if(typeof sheet.addRule === 'function') { sheet.addRule(selector, rules, index); } }, @@ -437,8 +437,13 @@ if (typeof max_height == 'undefined') { max_height = this._styles._max; this._styles._max = 0; + var f = function () {}; + if (typeof this._styles.removeRule === 'function') + f = this._styles.removeRule; + else if (typeof this._styles.deleteRule === 'function') + f = this._styles.deleteRule; while (this._styles.rules.length) { - this._styles.removeRule(0); + f(0); } this._update_container_height(); }