Files
GPW/GPW_Smart/Scripts/src/utils/getWindow.js
T
2020-01-28 10:17:12 +01:00

10 lines
261 B
JavaScript

/**
* Get the window associated with the element
* @argument {Element} element
* @returns {Window}
*/
export default function getWindow(element) {
const ownerDocument = element.ownerDocument;
return ownerDocument ? ownerDocument.defaultView : window;
}