Zebra: apply style one row. Fixes #715

This commit is contained in:
Mottie 2014-09-02 09:23:41 -05:00
parent d4a5cc196a
commit 3aa474012d

View File

@ -1863,21 +1863,18 @@
} }
for (k = 0; k < b.length; k++ ) { for (k = 0; k < b.length; k++ ) {
// loop through the visible rows // loop through the visible rows
row = 0;
$tb = b.eq(k); $tb = b.eq(k);
l = $tb.children('tr').length; $tv = $tb.children('tr:visible').not(c.selectorRemove);
if (l > 1) { // revered back to using jQuery each - strangely it's the fastest method
row = 0; /*jshint loopfunc:true */
$tv = $tb.children('tr:visible').not(c.selectorRemove); $tv.each(function(){
// revered back to using jQuery each - strangely it's the fastest method $tr = $(this);
/*jshint loopfunc:true */ // style child rows the same way the parent row was styled
$tv.each(function(){ if (!child.test(this.className)) { row++; }
$tr = $(this); even = (row % 2 === 0);
// style children rows the same way the parent row was styled $tr.removeClass(wo.zebra[even ? 1 : 0]).addClass(wo.zebra[even ? 0 : 1]);
if (!child.test(this.className)) { row++; } });
even = (row % 2 === 0);
$tr.removeClass(wo.zebra[even ? 1 : 0]).addClass(wo.zebra[even ? 0 : 1]);
});
}
} }
if (c.debug) { if (c.debug) {
ts.benchmark("Applying Zebra widget", time); ts.benchmark("Applying Zebra widget", time);