mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
20 lines
785 B
JavaScript
20 lines
785 B
JavaScript
M.mod_scormform = {};
|
|
M.mod_scormform.init = function(Y) {
|
|
var scormform = Y.one('#scormviewform');
|
|
var cwidth = scormplayerdata.cwidth;
|
|
var cheight = scormplayerdata.cheight;
|
|
var poptions = scormplayerdata.popupoptions;
|
|
if ((cwidth==100) && (cheight==100)) {
|
|
poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
|
|
} else {
|
|
if (cwidth<=100) {
|
|
cwidth = Math.round(screen.availWidth * cwidth / 100);
|
|
}
|
|
if (cheight<=100) {
|
|
cheight = Math.round(screen.availHeight * cheight / 100);
|
|
}
|
|
poptions = poptions+',width='+cwidth+',height='+cheight;
|
|
}
|
|
scormform.setAttribute('onsubmit', "window.open('','Popup','"+poptions+"'); this.target='Popup';");
|
|
}
|