Browse Source

BI-47693 fix: 现代浏览器中,BI.ResizeDetector.addResizeListener会默认执行一次。

es6
dailer 6 years ago
parent
commit
5c4d00ea1b
  1. 6
      src/core/platform/web/detectElementResize.js

6
src/core/platform/web/detectElementResize.js

@ -112,8 +112,10 @@
};
var addResizeListener = function (element, fn) {
if (attachEvent) element.attachEvent("onresize", fn);
else {
if (attachEvent) {
element.attachEvent("onresize", fn);
fn();
} else {
if (!element.__resizeTriggers__) {
if (getComputedStyle(element).position === "static") element.style.position = "relative";
createStyles();

Loading…
Cancel
Save