jquery-tablesorter and sortable classes always added together
authorjdlrobson <jdlrobson@gmail.com>
Mon, 7 May 2018 19:45:13 +0000 (12:45 -0700)
committerjdlrobson <jdlrobson@gmail.com>
Mon, 7 May 2018 19:48:22 +0000 (12:48 -0700)
If absent, jquery-tablesorter should add the sortable class.
The sortable class should be used to avoid FOUC, but clients
may need time to update their interfaces to do so.

Bug: T194045
Change-Id: I76709bf30ab06ff5ee7fc18bed1f143002477529

resources/src/jquery/jquery.tablesorter.js

index e9d5a91..552c0c3 100644 (file)
                                                return;
                                        }
                                }
-                               $table.addClass( 'jquery-tablesorter' );
+                               // The `sortable` class is used to identify tables which will become sortable
+                               // If not used it will create a FOUC but it should be added since the sortable class
+                               // is responsible for certain crucial style elements. If the class is already present
+                               // this action will be harmless.
+                               $table.addClass( 'jquery-tablesorter sortable' );
 
                                // Merge and extend
                                config = $.extend( {}, $.tablesorter.defaultOptions, settings );