open-codetree / utils /nativePopup.ts
matt HOFFNER
init
3c3f089
raw
history blame contribute delete
518 Bytes
interface Popups {
pageURL: string;
pageTitle: string;
popupWinWidth: number;
popupWinHeight: number;
}
export function nativePopup({
pageURL,
pageTitle,
popupWinWidth,
popupWinHeight,
}: Popups) {
let left = (screen.width - popupWinWidth) / 2;
let top = (screen.height - popupWinHeight) / 4;
window.open(
pageURL,
pageTitle,
"resizable=yes, width=" +
popupWinWidth +
", height=" +
popupWinHeight +
", top=" +
top +
", left=" +
left
);
}