From a3571c85a3ac40f52ba41baecb599f671673fc09 Mon Sep 17 00:00:00 2001 From: Andreas Hjortland Date: Wed, 6 Nov 2019 11:23:57 +0100 Subject: [PATCH] Fix positioning of popup login window It is now positioned centered relative to parent window instead of relative to primary monitor --- projects/lib/src/oauth-service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index 2b9de9dc..c1a1ba5f 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -955,11 +955,11 @@ export class OAuthService extends AuthConfig implements OnDestroy { } protected calculatePopupFeatures(options: { height?: number, width?: number }) { - // Specify an static height and width and calculate centered position + // Specify an static height and width and calculate centered position relative to the current window const height = options.height || 470; const width = options.width || 500; - const left = (screen.width / 2) - (width / 2); - const top = (screen.height / 2) - (height / 2); + const left = window.screenLeft + ((window.outerWidth - width) / 2); + const top = window.screenTop + ((window.outerHeight - height) / 2); return `location=no,toolbar=no,width=${width},height=${height},top=${top},left=${left}`; }