diff --git a/mod/scorm/player.js b/mod/scorm/player.js index 5f9457de386..1341380e98d 100644 --- a/mod/scorm/player.js +++ b/mod/scorm/player.js @@ -1,4 +1,12 @@ 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; @@ -7,13 +15,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; }