17 lines
530 B
TypeScript
17 lines
530 B
TypeScript
export function useGrateWizard() {
|
|
const appConfig = useAppConfig()
|
|
|
|
function launch() {
|
|
const { url, popup } = appConfig.gratewizard as { url: string; popup: { width: number; height: number } }
|
|
const left = Math.round((window.screen.width - popup.width) / 2)
|
|
const top = Math.round((window.screen.height - popup.height) / 2)
|
|
window.open(
|
|
url,
|
|
'GrateWizard',
|
|
`width=${popup.width},height=${popup.height},left=${left},top=${top},scrollbars=yes,resizable=yes`,
|
|
)
|
|
}
|
|
|
|
return { launch }
|
|
}
|