Permalink
Browse files

remove ties to the default html for rows and cells when adding odd/ev…

…en and first/last classes on section buildout; rely on children of the row/section instead
  • Loading branch information...
1 parent e8e7f4c commit 25f23d942368d9847441c30033b1b9edd4f6eb07 @kflorence committed Oct 12, 2010
Showing with 9 additions and 10 deletions.
  1. +9 −10 src/jquery.tabulate.js
View
@@ -1089,20 +1089,19 @@
dataset: data
}, $.getObject(r, options.rows));
- $row.find(".tabulate-cell:first").addClass("tabulate-first");
- $row.find(".tabulate-cell:last").addClass("tabulate-last");
- $row.find(".tabulate-cell:first").addClass("tabulate-first");
- $row.find(".tabulate-cell:last").addClass("tabulate-last");
+ $row.children(":odd").addClass("tabulate-even");
+ $row.children(":even").addClass("tabulate-odd");
+ $row.children(":first").addClass("tabulate-first");
+ $row.children(":last").addClass("tabulate-last");
$section.append($row);
}
});
-
- // add classes
- $section.find(".tabulate-row:odd").addClass("tabulate-even");
- $section.find(".tabulate-row:even").addClass("tabulate-odd");
- $section.find(".tabulate-row:first").addClass("tabulate-first");
- $section.find(".tabulate-row:last").addClass("tabulate-last");
+
+ $section.children(":odd").addClass("tabulate-even");
+ $section.children(":even").addClass("tabulate-odd");
+ $section.children(":first").addClass("tabulate-first");
+ $section.children(":last").addClass("tabulate-last");
// update column count
this.columns = Math.max(this.columns, data.length);

0 comments on commit 25f23d9

Please sign in to comment.