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