Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -352,4 +352,20 @@ |
353 | 353 | } |
354 | 354 | ); |
355 | 355 | |
| 356 | +ascendingNameLegacy = ascendingName.slice(0); |
| 357 | +ascendingNameLegacy[4] = ascendingNameLegacy[5]; |
| 358 | +ascendingNameLegacy.pop(); |
| 359 | + |
| 360 | +tableTest( |
| 361 | + 'Legacy compat with .sortbottom', |
| 362 | + header, |
| 363 | + planets, |
| 364 | + ascendingNameLegacy, |
| 365 | + function( $table ) { |
| 366 | + $table.find('tr:last').addClass('sortbottom'); |
| 367 | + $table.tablesorter(); |
| 368 | + $table.find('.headerSort:eq(0)').click(); |
| 369 | + } |
| 370 | +); |
| 371 | + |
356 | 372 | })(); |
Index: trunk/phase3/resources/jquery/jquery.tablesorter.js |
— | — | @@ -539,6 +539,13 @@ |
540 | 540 | |
541 | 541 | if ( firstTime ) { |
542 | 542 | firstTime = false; |
| 543 | + |
| 544 | + // Legacy fix of .sortbottoms |
| 545 | + // Wrap them inside inside a tfoot (because that's what they actually want to be) & |
| 546 | + // Move them up one level in the DOM |
| 547 | + var sortbottoms = $table.find('tr.sortbottom').wrap('<tfoot>'); |
| 548 | + sortbottoms.parents('table').append(sortbottoms.parent()); |
| 549 | + |
543 | 550 | explodeRowspans( $table ); |
544 | 551 | // try to auto detect column type, and store in tables config |
545 | 552 | table.config.parsers = buildParserCache( table, $headers ); |