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() {
|
||||
var el = document.getElementsByTagName('input');
|
||||
for(var i=0; i<el.length; i++) {
|
||||
if(el[i].type == 'checkbox') {
|
||||
el[i].checked = true;
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
if (inputs[i].type == 'checkbox') {
|
||||
inputs[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checknone() {
|
||||
var el = document.getElementsByTagName('input');
|
||||
for(var i=0; i<el.length; i++) {
|
||||
if(el[i].type == 'checkbox') {
|
||||
el[i].checked = false;
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
if (inputs[i].type == 'checkbox') {
|
||||
inputs[i].checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lockoptions(formid, master, subitems) {
|
||||
@ -770,9 +770,12 @@ function getElementsByClassName(oElm, strTagName, oClassNames) {
|
||||
function openpopup(url, name, options, fullscreen) {
|
||||
var fullurl = url;
|
||||
if (!url.match(/https?:\/\//)) {
|
||||
var fullurl = moodle_cfg.wwwroot + url;
|
||||
fullurl = moodle_cfg.wwwroot + url;
|
||||
}
|
||||
var windowobj = window.open(fullurl,name,options);
|
||||
if (!windowobj) {
|
||||
return true;
|
||||
}
|
||||
if (fullscreen) {
|
||||
windowobj.moveTo(0,0);
|
||||
windowobj.resizeTo(screen.availWidth,screen.availHeight);
|
||||
|
Loading…
x
Reference in New Issue
Block a user