mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
column widget code cleanup
This commit is contained in:
parent
2993069e04
commit
ecf9693354
@ -287,20 +287,16 @@ ts.addWidget({
|
|||||||
ts.processTbody(table, $tb, false);
|
ts.processTbody(table, $tb, false);
|
||||||
}
|
}
|
||||||
// add classes to thead and tfoot
|
// add classes to thead and tfoot
|
||||||
$tr = wo.columns_thead !== false ? 'thead tr' : '';
|
$tr = wo.columns_thead !== false ? ['thead tr'] : [];
|
||||||
if (wo.columns_tfoot !== false) {
|
if (wo.columns_tfoot !== false) {
|
||||||
$tr += ($tr === '' ? '' : ',') + 'tfoot tr';
|
$tr.push('tfoot tr');
|
||||||
}
|
}
|
||||||
if ($tr.length) {
|
if ($tr.length) {
|
||||||
$t = $tbl.find($tr).children().removeClass(rmv);
|
$t = $tbl.find($tr.join(',')).children().removeClass(rmv);
|
||||||
if (list && list[0]){
|
if (len){
|
||||||
// primary sort column class
|
for (i = 0; i < len; i++){
|
||||||
$t.filter('[data-column="' + list[0][0] + '"]').addClass(css[0]);
|
// add primary. secondary, tertiary, etc sort column classes
|
||||||
if (len > 1){
|
$t.filter('[data-column="' + list[i][0] + '"]').addClass(css[i] || css[last]);
|
||||||
for (i = 1; i < len; i++){
|
|
||||||
// secondary, tertiary, etc sort column classes
|
|
||||||
$t.filter('[data-column="' + list[i][0] + '"]').addClass(css[i] || css[last]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user