improved pointer code (for Opera 6.0)

This commit is contained in:
Loïc Chapeaux
2001-12-08 09:42:56 +00:00
parent a605108a67
commit 1c554449ea
2 changed files with 14 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ $Source$
2001-12-08 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* 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<4C>c Chapeaux <lolo@phpheaven.net>

View File

@@ -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;