MDL-32388 SCORM: Fix chrome pop-ups
[moodle.git] / mod / scorm / player.js
index 2758d93..84be215 100644 (file)
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 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