Check if there is a prexisting tfoot, before creating a new one.
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Sat, 8 Oct 2011 19:28:10 +0000 (19:28 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Sat, 8 Oct 2011 19:28:10 +0000 (19:28 +0000)
Follow up to r98669, though this was a problem that also could surface without tfoot emulation.

resources/jquery/jquery.tablesorter.js

index c988612..76ab215 100644 (file)
                                                        // and put the <tfoot> at the end of the <table>
                                                        var $sortbottoms = $table.find( 'tr.sortbottom' );
                                                        if ( $sortbottoms.length ) {
-                                                               $table.append( $( '<tfoot>' ).append( $sortbottoms ) )
+                                                               var $tfoot = $table.find( 'tfoot' );
+                                                               if( $tfoot ) {
+                                                                       $tfoot.eq(0).prepend( $sortbottoms );
+                                                               } else {
+                                                                       $table.append( $( '<tfoot>' ).append( $sortbottoms ) )
+                                                               }
                                                        }
 
                                                        explodeRowspans( $table );