mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-07 11:36:47 +00:00
Prettier 2.0 (#393)
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
export const getDataExplorerWindow = (currentWindow: Window): Window | undefined => {
|
||||
// Data explorer is always loaded in an iframe, so traverse the parents until we hit the top and return the first child window.
|
||||
try {
|
||||
while (currentWindow) {
|
||||
if (currentWindow.parent === currentWindow) {
|
||||
return undefined;
|
||||
}
|
||||
if (currentWindow.parent === currentWindow.top) {
|
||||
return currentWindow;
|
||||
}
|
||||
currentWindow = currentWindow.parent;
|
||||
}
|
||||
} catch (error) {
|
||||
// Hitting a cross domain error means we are in the portal and the current window is data explorer
|
||||
return currentWindow;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
export const getDataExplorerWindow = (currentWindow: Window): Window | undefined => {
|
||||
// Data explorer is always loaded in an iframe, so traverse the parents until we hit the top and return the first child window.
|
||||
try {
|
||||
while (currentWindow) {
|
||||
if (currentWindow.parent === currentWindow) {
|
||||
return undefined;
|
||||
}
|
||||
if (currentWindow.parent === currentWindow.top) {
|
||||
return currentWindow;
|
||||
}
|
||||
currentWindow = currentWindow.parent;
|
||||
}
|
||||
} catch (error) {
|
||||
// Hitting a cross domain error means we are in the portal and the current window is data explorer
|
||||
return currentWindow;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user