r91207 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91206‎ | r91207 | r91208 >
Date:19:40, 30 June 2011
Author:diebuche
Status:ok (Comments)
Tags:
Comment:
r86088: Adding legacy support for .sortbottom & a test for it per CR
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.tablesorter.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
@@ -352,4 +352,20 @@
353353 }
354354 );
355355
 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+
356372 })();
Index: trunk/phase3/resources/jquery/jquery.tablesorter.js
@@ -539,6 +539,13 @@
540540
541541 if ( firstTime ) {
542542 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+
543550 explodeRowspans( $table );
544551 // try to auto detect column type, and store in tables config
545552 table.config.parsers = buildParserCache( table, $headers );

Follow-up revisions

RevisionCommit summaryAuthorDate
r91221r91207: Make one qunit test var local. Thanks Krinklediebuche21:13, 30 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86088Completely rewritten table sorting script....diebuche21:47, 14 April 2011

Comments

#Comment by Krinkle (talk | contribs)   21:09, 30 June 2011

ascendingNameLegacy wasn't supposed to be a global variable, right ?

Status & tagging log