(bug 15399) Disable odd/even classes for sortable tables
authorAryeh Gregor <simetrical@users.mediawiki.org>
Mon, 1 Sep 2008 19:15:04 +0000 (19:15 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Mon, 1 Sep 2008 19:15:04 +0000 (19:15 +0000)
These might or might not be useful, but if they are useful they should be added in PHP, not JavaScript.  There have been reports of significant slowness for large tables due to the row numbering.  This also fixes a bug where setting ts_alternate_row_colors = false would only work until the user tried sorting the table.

Patch by Mike Horvath.

CREDITS
RELEASE-NOTES
skins/common/wikibits.js

diff --git a/CREDITS b/CREDITS
index 0d9130c..8222e5e 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -43,6 +43,7 @@ following names for their contribution to the product.
 * Jeremy Baron
 * Louperivois
 * Max Semenik
+* Mike Horvath
 * Mormegil
 * RememberTheDot
 * Soxred93
index 04515da..a6f5249 100644 (file)
@@ -173,6 +173,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   Use a separate database connection for the objectcache table to avoid 
   long-lasting locks on that table.
 * Respect file restrictions in the file history list
+* (bug 15399) Odd/even classes on sortable tables' rows could be slow for large
+  tables, and have been disabled by default.
 
 
 === API changes in 1.14 ===
index 59f15ce..a762ae5 100644 (file)
@@ -518,7 +518,7 @@ var ts_image_up = "sort_up.gif";
 var ts_image_down = "sort_down.gif";
 var ts_image_none = "sort_none.gif";
 var ts_europeandate = wgContentLanguage != "en"; // The non-American-inclined can change to "true"
-var ts_alternate_row_colors = true;
+var ts_alternate_row_colors = false;
 var SORT_COLUMN_INDEX;
 
 function sortables_init() {
@@ -661,7 +661,9 @@ function ts_resortTable(lnk) {
        }
        span.innerHTML = arrowHTML;
 
-       ts_alternate(table);            
+       if (ts_alternate_row_colors) {
+               ts_alternate(table);
+       }
 }
 
 function ts_dateToSortKey(date) {