diff --git a/netwerk/streamconv/converters/nsIndexedToHTML.cpp b/netwerk/streamconv/converters/nsIndexedToHTML.cpp index 3f83996c510..71aadc0f7f3 100644 --- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp +++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp @@ -290,6 +290,9 @@ nsIndexedToHTML::OnStartRequest(nsIRequest* request, nsISupports *aContext) { " text-align: left;\n" " white-space: nowrap;\n" "}\n" + "th > a {\n" + " color: inherit;\n" + "}\n" "table[order] th {\n" " cursor: pointer;\n" "}\n" @@ -369,18 +372,26 @@ nsIndexedToHTML::OnStartRequest(nsIRequest* request, nsISupports *aContext) { "var gTable, gOrderBy, gTBody, gRows, gUI_showHidden;\n" "document.addEventListener(\"DOMContentLoaded\", function() {\n" " gTable = document.getElementsByTagName(\"table\")[0];\n" + " gTBody = gTable.tBodies[0];\n" + " if (gTBody.rows.length < 2)\n" + " return;\n" " gUI_showHidden = document.getElementById(\"UI_showHidden\");\n" " var headCells = gTable.tHead.rows[0].cells,\n" " hiddenObjects = false;\n" " function rowAction(i) {\n" - " return function() {\n" + " return function(event) {\n" + " event.preventDefault();\n" " orderBy(i);\n" " }\n" " }\n" - " for (var i = headCells.length - 1; i >= 0; i--)\n" - " headCells[i].addEventListener(\"click\", rowAction(i), false);\n" + " for (var i = headCells.length - 1; i >= 0; i--) {\n" + " var anchor = document.createElement(\"a\");\n" + " anchor.href = \"\";\n" + " anchor.appendChild(headCells[i].firstChild);\n" + " headCells[i].appendChild(anchor);\n" + " headCells[i].addEventListener(\"click\", rowAction(i), true);\n" + " }\n" " gOrderBy = gTable.getAttribute(\"order-by\");\n" - " gTBody = gTable.tBodies[0];\n" " gRows = [];\n" " for (var row, i = gTBody.rows.length - 1; i >= 0; i--) {\n" " row = gTBody.rows[i];\n"