FSN#34665 changed thead.rows for thead.getElementByTagName for IE compatibility

svn path=/Website/trunk/; revision=31274
This commit is contained in:
2016-10-28 07:14:43 +00:00
parent 08a0ca8741
commit 9cf31ed253

View File

@@ -46,10 +46,11 @@ var sorttable = {
the.appendChild(table.rows[0]);
table.insertBefore(the,table.firstChild);
}
// Safari doesn't support table.tHead, sigh
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
if (table.tHead.rows.length != 1) return; // can't cope with two header rows
var tableTheadTRs = table.getElementsByTagName('thead')[0].getElementsByTagName('tr');
// can't cope with two header rows
if (tableTheadTRs.length != 1) return;
// Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
// "total" rows, for example). This is B&R, since what you're supposed
@@ -74,7 +75,8 @@ var sorttable = {
}
// work through each column and calculate its type
var headrow = table.tHead.rows[0].cells;
var headrow = tableTheadTRs[0].querySelectorAll('td, th');
for (var i=0; i<headrow.length; i++) {
// manually override the type with a sorttable_type attribute
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
@@ -100,7 +102,6 @@ var sorttable = {
doSort: function (e)
{
/* JGL */ if (this.preSorttable) eval(this.preSorttable);
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
// if we're already sorted by this column, just
// reverse the table, which is quicker
@@ -174,9 +175,8 @@ var sorttable = {
/* JGL */ FcltMgr.resized();
},
// floating headers hebben 2x <thead>
// Adapt the width of the floating header to the original when it is changed due to sorting
corrFloat: function() {
var sib = this.parentNode.parentNode.nextSibling;
if (sib && sib.nodeName == "THEAD" && sib.className == "tableFloatingHeaderOriginal")
{