Merge branch 'MDL-46236' of git://github.com/nobelium/moodle

This commit is contained in:
Dan Poltawski 2014-07-29 12:04:29 +01:00
commit 2ac36ad587

View File

@ -65,6 +65,7 @@ M.mod_scormform.init = function(Y) {
}
if (launch == true) {
setlaunchoptions();
winobj = window.open(launch_url,'Popup', poptions);
this.target='Popup';
scormredirect(winobj);
@ -72,10 +73,18 @@ M.mod_scormform.init = function(Y) {
// Listen for view form submit and generate popup on user interaction.
if (scormform) {
Y.on('submit', function(e) {
setlaunchoptions();
winobj = window.open(launch_url, 'Popup', poptions);
this.target='Popup';
scormredirect(winobj);
e.preventDefault();
}, scormform);
}
var setlaunchoptions = function() {
var mode = Y.one('#scormviewform input[name=mode]:checked').get('value');
launch_url += '&mode=' + (mode ? mode : 'normal');
var newattempt = Y.one('#scormviewform #a');
launch_url += (newattempt && newattempt.get('checked') ? '&newattempt=on' : '');
}
}