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