Merge branch 'MDL-34590_22' of git://github.com/timhunt/moodle into MOODLE_22_STABLE

This commit is contained in:
Dan Poltawski
2012-08-06 10:11:33 +08:00
+12 -2
View File
@@ -1113,13 +1113,23 @@ function openpopup(event, args) {
if (!args.url.match(/https?:\/\//)) {
fullurl = M.cfg.wwwroot + args.url;
}
if (args.fullscreen) {
args.options = args.options.
replace(/top=\d+/, 'top=0').
replace(/left=\d+/, 'left=0').
replace(/width=\d+/, 'width=' + screen.availWidth).
replace(/height=\d+/, 'height=' + screen.availHeight);
}
var windowobj = window.open(fullurl,args.name,args.options);
if (!windowobj) {
return true;
}
if (args.fullscreen) {
windowobj.moveTo(0,0);
windowobj.resizeTo(screen.availWidth,screen.availHeight);
setTimeout(function() {
windowobj.moveTo(0, 0);
windowobj.resizeTo(screen.availWidth, screen.availHeight)
}, 0);
}
windowobj.focus();