Merge branch 'MDL-57472-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
David Monllao 2016-12-28 13:37:19 +01:00 committed by Dan Poltawski
commit 7454d5fb37
2 changed files with 8 additions and 35 deletions

View File

@ -1063,43 +1063,18 @@ function filterByParent(elCollection, parentFinder) {
return filteredCollection;
}
/*
All this is here just so that IE gets to handle oversized blocks
in a visually pleasing manner. It does a browser detect. So sue me.
*/
/**
* @deprecated since Moodle 3.3, but shouldn't be used in earlier versions either.
*/
function fix_column_widths() {
var agt = navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
fix_column_width('left-column');
fix_column_width('right-column');
}
Y.log('fix_column_widths() no longer does anything. Please remove it from your code.', 'warn', 'javascript-static.js');
}
/**
* @deprecated since Moodle 3.3, but shouldn't be used in earlier versions either.
*/
function fix_column_width(colName) {
if(column = document.getElementById(colName)) {
if(!column.offsetWidth) {
setTimeout("fix_column_width('" + colName + "')", 20);
return;
}
var width = 0;
var nodes = column.childNodes;
for(i = 0; i < nodes.length; ++i) {
if(nodes[i].className.indexOf("block") != -1 ) {
if(width < nodes[i].offsetWidth) {
width = nodes[i].offsetWidth;
}
}
}
for(i = 0; i < nodes.length; ++i) {
if(nodes[i].className.indexOf("block") != -1 ) {
nodes[i].style.width = width + 'px';
}
}
}
Y.log('fix_column_width() no longer does anything. Please remove it from your code.', 'warn', 'javascript-static.js');
}

View File

@ -576,8 +576,6 @@ class core_renderer extends renderer_base {
'loadinghelp',
), 'moodle');
$this->page->requires->js_function_call('setTimeout', array('fix_column_widths()', 20));
$focus = $this->page->focuscontrol;
if (!empty($focus)) {
if (preg_match("#forms\['([a-zA-Z0-9]+)'\].elements\['([a-zA-Z0-9]+)'\]#", $focus, $matches)) {