Permalink
Browse files

MDL-32388 SCORM: Fix chrome pop-ups

  • Loading branch information...
1 parent f24ff8f commit 2ed2d8c111e121b8ea414ba7d96b67a918a8c3e8 @danmarsden danmarsden committed Apr 11, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 mod/scorm/player.js
View
@@ -14,6 +14,14 @@
// 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;
-}
+}

0 comments on commit 2ed2d8c

Please sign in to comment.