From 8ae6b25b7971d63a2eaf4ea9eeb383ebc9abf5b7 Mon Sep 17 00:00:00 2001 From: Vibhu Dujari Date: Thu, 16 May 2024 13:41:20 +0530 Subject: [PATCH] open popup in maxWidth/Height available --- app/pods/components/intermediate-contest-view/component.js | 2 +- app/pods/contests/contest/index/controller.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/pods/components/intermediate-contest-view/component.js b/app/pods/components/intermediate-contest-view/component.js index 13b0dbf..1233640 100644 --- a/app/pods/components/intermediate-contest-view/component.js +++ b/app/pods/components/intermediate-contest-view/component.js @@ -118,6 +118,6 @@ export default class IntermediateContestComponent extends Component { } @action async openTestInNewWindow() { - window.open(`${ENV.publicUrl}/contests/${this.contest.id}/attempt/`, '_blank', 'popup') + window.open(`${ENV.publicUrl}/contests/${this.contest.id}/attempt/`, '_blank', `menubar=1,resizable=0,height=${window.screen.availHeight},width=${window.screen.availWidth}`) } } diff --git a/app/pods/contests/contest/index/controller.js b/app/pods/contests/contest/index/controller.js index 9cafa9b..83bf44f 100644 --- a/app/pods/contests/contest/index/controller.js +++ b/app/pods/contests/contest/index/controller.js @@ -62,6 +62,6 @@ export default class IndexController extends Controller { } @action onAfterCreate() { - window.open(`${ENV.publicUrl}/contests/${this.contest.id}/attempt/`, '_blank', 'popup') + window.open(`${ENV.publicUrl}/contests/${this.contest.id}/attempt/`, `hackerblocks-contest-${this.contest.id}`, `menubar=0,resizable=0,height=${window.screen.availHeight},width=${window.screen.availWidth}`) } }