diff --git a/ChangeLog b/ChangeLog index 6252cf5e4..008f62899 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ $Source$ 2001-12-08 Loïc Chapeaux * libraries/left.js, lines 234-240: fixed a js bug with empty databases. + * libraries/functions.js: improved pointer code (for Opera 6.0). * left.php3: nicer codding for Opera exception. 2001-12-07 Loïc Chapeaux diff --git a/libraries/functions.js b/libraries/functions.js index cf4026f0f..aa5bf3e37 100644 --- a/libraries/functions.js +++ b/libraries/functions.js @@ -305,14 +305,22 @@ function checkTransmitDump(theForm, theAction) */ function setPointer(theRow, thePointerColor) { - if (thePointerColor == '' - || (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined')) { + if (thePointerColor == '' || typeof(theRow.style) == 'undefined') { + return false; + } + if (typeof(document.getElementsByTagName) != 'undefined') { + var theCells = theRow.getElementsByTagName('td'); + } + else if (typeof(theRow.cells) != 'undefined') { + var theCells = theRow.cells; + } + else { return false; } - var row_cells_cnt = theRow.cells.length; - for (var c = 0; c < row_cells_cnt; c++) { - theRow.cells[c].style.backgroundColor = thePointerColor; + var rowCellsCnt = theCells.length; + for (var c = 0; c < rowCellsCnt; c++) { + theCells[c].style.backgroundColor = thePointerColor; } return true;