Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 548c128

Browse files
committed
update gridstack.js
1 parent 4a4b627 commit 548c128

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

gridstack.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
},
3434

3535
insert_css_rule: function (sheet, selector, rules, index) {
36-
if("insertRule" in sheet) {
36+
if(typeof sheet.insertRule === 'function') {
3737
sheet.insertRule(selector + "{" + rules + "}", index);
3838
}
39-
else if("addRule" in sheet) {
39+
else if(typeof sheet.addRule === 'function') {
4040
sheet.addRule(selector, rules, index);
4141
}
4242
},
@@ -437,8 +437,13 @@
437437
if (typeof max_height == 'undefined') {
438438
max_height = this._styles._max;
439439
this._styles._max = 0;
440+
var f = function () {};
441+
if (typeof this._styles.removeRule === 'function')
442+
f = this._styles.removeRule;
443+
else if (typeof this._styles.deleteRule === 'function')
444+
f = this._styles.deleteRule;
440445
while (this._styles.rules.length) {
441-
this._styles.removeRule(0);
446+
f(0);
442447
}
443448
this._update_container_height();
444449
}

0 commit comments

Comments
 (0)