From cab0c534f1b49bed096ec6ac82ab91aa739a7ed0 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 19 Oct 2012 15:31:35 +0100 Subject: [PATCH] Fix - core: Stripe removal was broken - it was stripping the classes from only the first row rows, rather than all of them, which was wrong. This was unfortunatly introduced in 1.9.4 and there weren't any unit tests to catch it. There are now, and I've rewritten the code that wil remove existing stripe classes. Its now much smaller and should be a little faster. Now it only checks the first row to see if it has any exisiting stripe classes, which is good enough. The smallest this could could be would be a simple removeClass, but that may result in significant overhead which really isn't needed in cases where there are no exisiting stripe classes. --- media/js/jquery.dataTables.js | 27 ++------ media/src/core/core.constructor.js | 27 ++------ .../1_dom/gh125 - stripe stripping.js | 61 +++++++++++++++++++ 3 files changed, 73 insertions(+), 42 deletions(-) create mode 100755 media/unit_testing/tests_onhold/1_dom/gh125 - stripe stripping.js diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 003f04e8..0ad7c54a 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -6617,27 +6617,12 @@ } /* Remove row stripe classes if they are already on the table row */ - iLen=oSettings.asStripeClasses.length; - oSettings.asDestroyStripes = []; - if (iLen) - { - var bStripeRemove = false; - var anRows = $(this).children('tbody').children('tr:lt(' + iLen + ')'); - for ( i=0 ; i