From 2ed2d8c111e121b8ea414ba7d96b67a918a8c3e8 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 11 Apr 2012 20:46:53 +1200 Subject: [PATCH] MDL-32388 SCORM: Fix chrome pop-ups --- mod/scorm/player.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mod/scorm/player.js b/mod/scorm/player.js index 2758d9348e0..84be2155226 100644 --- a/mod/scorm/player.js +++ b/mod/scorm/player.js @@ -14,6 +14,14 @@ // along with Moodle. If not, see . function scorm_openpopup(url,name,options,width,height) { + if (width<=100) { + width = Math.round(screen.availWidth * width / 100); + } + if (height<=100) { + height = Math.round(screen.availHeight * height / 100); + } + options += ",width="+width+",height="+height; + windowobj = window.open(url,name,options); if (!windowobj) { return; @@ -22,13 +30,6 @@ function scorm_openpopup(url,name,options,width,height) { // Fullscreen windowobj.moveTo(0,0); } - if (width<=100) { - width = Math.round(screen.availWidth * width / 100); - } - if (height<=100) { - height = Math.round(screen.availHeight * height / 100); - } - windowobj.resizeTo(width,height); windowobj.focus(); return windowobj; -} +} \ No newline at end of file