Merge "jquery.tablesorter: buildCollationTable() on first sort, not on load"
authorTheDJ <hartman.wiki@gmail.com>
Wed, 14 Aug 2013 18:57:35 +0000 (18:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Aug 2013 18:57:35 +0000 (18:57 +0000)
1  2 
resources/jquery/jquery.tablesorter.js

                                        .addClass( table.config.cssHeader )
                                        .prop( 'tabIndex', 0 )
                                        .attr( {
 -                                              role: 'button',
 +                                              role: 'columnheader button',
                                                title: msg[1]
                                        } );
                        }
                                        // Build headers
                                        $headers = buildHeaders( table, sortMsg );
  
-                                       // Grab and process locale settings
+                                       // Grab and process locale settings.
                                        buildTransformTable();
                                        buildDateTable();
-                                       buildCollationTable();
  
                                        // Precaching regexps can bring 10 fold
                                        // performance improvements in some browsers.
                                        function setupForFirstSort() {
                                                firstTime = false;
  
+                                               // Defer buildCollationTable to first sort. As user and site scripts
+                                               // may customize tableSorterCollation but load after $.ready(), other
+                                               // scripts may call .tablesorter() before they have done the
+                                               // tableSorterCollation customizations.
+                                               buildCollationTable();
                                                // Legacy fix of .sortbottoms
                                                // Wrap them inside inside a tfoot (because that's what they actually want to be) &
                                                // and put the <tfoot> at the end of the <table>