From: MatmaRex Date: Wed, 24 Jul 2013 18:33:24 +0000 (+0200) Subject: jquery.tablesorter: buildCollationTable() on first sort, not on load X-Git-Tag: 1.31.0-rc.0~18975^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=d93270d1b0a0187a06eb4e84f668bba06a2148bb;p=lhc%2Fweb%2Fwiklou.git jquery.tablesorter: buildCollationTable() on first sort, not on load Since user and site scripts are now loaded after $.ready(), other scripts may call .tablesorter() before they have done the tableSorterCollation customizations. Bug: 51982 Change-Id: I269181169a5e25fbd98eb2acbd9e2e0f45aaaa86 --- diff --git a/resources/jquery/jquery.tablesorter.js b/resources/jquery/jquery.tablesorter.js index 115a49acf5..aa95ec003e 100644 --- a/resources/jquery/jquery.tablesorter.js +++ b/resources/jquery/jquery.tablesorter.js @@ -717,10 +717,9 @@ // 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. @@ -729,6 +728,12 @@ 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 at the end of the