Browse Source

Merge pull request #248889 in DEC/fineui from release/11.0 to bugfix/11.0

* commit '4e0274fcc4a88b37972328d0b9f1db3ac4a659c5':
  fix(BI-134501): 主线不找最外层body
research/test
superman 1 year ago
parent
commit
788dd9b937
  1. 23
      packages/fineui/src/core/utils/dom.js

23
packages/fineui/src/core/utils/dom.js

@ -1,9 +1,9 @@
/** /**
* 对DOM操作的通用函数 * 对DOM操作的通用函数
*/ */
import { Widget } from "../4.widget";
import { each, isEmpty, isNull, isNotNull } from "../2.base";
import $ from "jquery"; import $ from "jquery";
import { each, isEmpty, isNotNull, isNull } from "../2.base";
import { Widget } from "../4.widget";
import { isIE } from "./../platform"; import { isIE } from "./../platform";
export function ready(fn) { export function ready(fn) {
@ -794,13 +794,14 @@ export function getPositionRelativeContainingBlockRect(element) {
*/ */
export function getOuterBody() { export function getOuterBody() {
// 默认挂在body上的都找最外层的body // 默认挂在body上的都找最外层的body
let parentWindow = window; // let parentWindow = window;
let body = document.body; // let body = document.body;
try { // try {
while (parentWindow.parent !== parentWindow) { // while (parentWindow.parent !== parentWindow) {
parentWindow = parentWindow.parent; // parentWindow = parentWindow.parent;
} // }
body = parentWindow.document.body; // body = parentWindow.document.body;
} catch (e) {} // } catch (e) {}
return body; // return body;
return document.body;
} }

Loading…
Cancel
Save