Files
librodrome/app/composables/useGrateWizard.ts
2026-02-20 12:55:10 +01:00

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 }
}