@openui5/sap.ui.core
Version:
OpenUI5 Core Library sap.ui.core
30 lines (25 loc) • 660 B
JavaScript
/*!
* OpenUI5
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define([], function() {
"use strict";
/**
* Returns the window reference for a DomRef.
*
* @function
* @since 1.58
* @param {Element} oDomRef The DOM reference
* @return {Window} Window reference
* @public
* @alias module:sap/ui/dom/getOwnerWindow
*/
var fnGetOwnerWindow = function ownerWindow(oDomRef){
if (oDomRef.ownerDocument.parentWindow) {
return oDomRef.ownerDocument.parentWindow;
}
return oDomRef.ownerDocument.defaultView;
};
return fnGetOwnerWindow;
});