TheDJ has submitted this change and it was merged.

Change subject: jquery.tablesorter: buildCollationTable() on first sort, not on 
load
......................................................................


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
---
M resources/jquery/jquery.tablesorter.js
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  TheDJ: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/jquery/jquery.tablesorter.js 
b/resources/jquery/jquery.tablesorter.js
index 115a49a..aa95ec0 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 <tfoot> at the 
end of the <table>

-- 
To view, visit https://gerrit.wikimedia.org/r/75671
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I269181169a5e25fbd98eb2acbd9e2e0f45aaaa86
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to