mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-15484 Avoid JavaScript errors after a popup has been blocked.
Also clean up coding style of some nearby functions.
This commit is contained in:
parent
8af809df9d
commit
214f5850d1
@ -10,21 +10,21 @@ function popupchecker(msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkall() {
|
function checkall() {
|
||||||
var el = document.getElementsByTagName('input');
|
var inputs = document.getElementsByTagName('input');
|
||||||
for(var i=0; i<el.length; i++) {
|
for (var i = 0; i < inputs.length; i++) {
|
||||||
if(el[i].type == 'checkbox') {
|
if (inputs[i].type == 'checkbox') {
|
||||||
el[i].checked = true;
|
inputs[i].checked = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checknone() {
|
function checknone() {
|
||||||
var el = document.getElementsByTagName('input');
|
var inputs = document.getElementsByTagName('input');
|
||||||
for(var i=0; i<el.length; i++) {
|
for (var i = 0; i < inputs.length; i++) {
|
||||||
if(el[i].type == 'checkbox') {
|
if (inputs[i].type == 'checkbox') {
|
||||||
el[i].checked = false;
|
inputs[i].checked = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function lockoptions(formid, master, subitems) {
|
function lockoptions(formid, master, subitems) {
|
||||||
@ -770,9 +770,12 @@ function getElementsByClassName(oElm, strTagName, oClassNames) {
|
|||||||
function openpopup(url, name, options, fullscreen) {
|
function openpopup(url, name, options, fullscreen) {
|
||||||
var fullurl = url;
|
var fullurl = url;
|
||||||
if (!url.match(/https?:\/\//)) {
|
if (!url.match(/https?:\/\//)) {
|
||||||
var fullurl = moodle_cfg.wwwroot + url;
|
fullurl = moodle_cfg.wwwroot + url;
|
||||||
}
|
}
|
||||||
var windowobj = window.open(fullurl,name,options);
|
var windowobj = window.open(fullurl,name,options);
|
||||||
|
if (!windowobj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
windowobj.moveTo(0,0);
|
windowobj.moveTo(0,0);
|
||||||
windowobj.resizeTo(screen.availWidth,screen.availHeight);
|
windowobj.resizeTo(screen.availWidth,screen.availHeight);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user