Open beita1991 opened 7 years ago
firefox 浏览器下,iframe中使用 ui-grid getStyles() 会有报错 ,因为e.ownerDocument.defaultView.getComputedStyle(e, null) 返回的是null,理论上不应该返回null的, 在getStyles 方法添加如下兼容代码:
function getStyles (elem) { var e = elem; if (typeof(e.length) !== 'undefined' && e.length) { e = elem[0]; } if (/firefox/i.test(navigator.userAgent)){ return e.ownerDocument.defaultView.getComputedStyle(e, null) || e.style || {}; } return e.ownerDocument.defaultView.getComputedStyle(e, null); }
firefox 浏览器下,iframe中使用 ui-grid getStyles() 会有报错 ,因为e.ownerDocument.defaultView.getComputedStyle(e, null) 返回的是null,理论上不应该返回null的, 在getStyles 方法添加如下兼容代码: