javascript:PMA_markRowsInit speedup

This commit is contained in:
Sebastian Mendel
2005-10-20 12:31:52 +00:00
parent 53f593fa58
commit 3d26b10f0d

View File

@@ -468,20 +468,13 @@ var marked_row = new Array;
*
*/
function PMA_markRowsInit() {
// in every table ...
var tables = document.getElementsByTagName('table');
for (var t=0; t<tables.length; t++) {
// ... with the class 'data' ...
if ( 'data' != tables[t].className ) {
// for every table row ...
var rows = document.getElementsByTagName('tr');
for ( var i = 0; i < rows.length; i++ ) {
// ... with the class 'odd' or 'even' ...
if ( 'odd' != rows[i].className && 'even' != rows[i].className ) {
continue;
}
// ... in tbody ...
var body = tables[t].getElementsByTagName('tbody')
// ... for every row ('tr') ...
var rows = body[0].getElementsByTagName('tr');
for (var i = 0; i < rows.length; i++) {
// ... add event listeners ...
// ... to highlight the row on mouseover ...
if ( navigator.appName == 'Microsoft Internet Explorer' ) {
@@ -500,11 +493,7 @@ function PMA_markRowsInit() {
var checkbox = this.getElementsByTagName( 'input' )[0];
if ( checkbox && checkbox.type == 'checkbox' ) {
if ( checkbox.id.length > 0 ) {
unique_id = checkbox.id;
} else {
unique_id = checkbox.name + checkbox.value;
}
} else if ( this.id.length > 0 ) {
unique_id = this.id;
} else {
@@ -545,7 +534,6 @@ function PMA_markRowsInit() {
}
}
}
}
window.onload=PMA_markRowsInit;
/**