UItheme: ignore nested tables

This commit is contained in:
Mottie 2014-10-04 11:50:30 -05:00
parent c13d0f65f5
commit 3058060a63

View File

@ -190,16 +190,16 @@ ts.addWidget({
if (themes.even !== '') { wo.zebra[0] += ' ' + themes.even; } if (themes.even !== '') { wo.zebra[0] += ' ' + themes.even; }
if (themes.odd !== '') { wo.zebra[1] += ' ' + themes.odd; } if (themes.odd !== '') { wo.zebra[1] += ' ' + themes.odd; }
// add caption style // add caption style
$table.find('caption').addClass(themes.caption); $table.children('caption').addClass(themes.caption);
// add table/footer class names // add table/footer class names
$tfoot = $table $tfoot = $table
// remove other selected themes // remove other selected themes
.removeClass( c.theme === '' ? '' : 'tablesorter-' + c.theme ) .removeClass( c.theme === '' ? '' : 'tablesorter-' + c.theme )
.addClass('tablesorter-' + theme + ' ' + themes.table) // add theme widget class name .addClass('tablesorter-' + theme + ' ' + themes.table) // add theme widget class name
.find('tfoot'); .children('tfoot');
if ($tfoot.length) { if ($tfoot.length) {
$tfoot $tfoot
.find('tr').addClass(themes.footerRow) .children('tr').addClass(themes.footerRow)
.children('th, td').addClass(themes.footerCells); .children('th, td').addClass(themes.footerCells);
} }
// update header classes // update header classes
@ -219,13 +219,13 @@ ts.addWidget({
$headers.find('.' + ts.css.icon).addClass(themes.icons); $headers.find('.' + ts.css.icon).addClass(themes.icons);
} }
if ($table.hasClass('hasFilters')) { if ($table.hasClass('hasFilters')) {
$headers.find('.' + ts.css.filterRow).addClass(themes.filterRow); $table.children('thead').children('.' + ts.css.filterRow).addClass(themes.filterRow);
} }
} }
for (i = 0; i < c.columns; i++) { for (i = 0; i < c.columns; i++) {
$header = c.$headers.add(c.$extraHeaders).filter('[data-column="' + i + '"]'); $header = c.$headers.add(c.$extraHeaders).filter('[data-column="' + i + '"]');
$icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $header; $icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $header;
$h = c.$headers.filter('[data-column="' + i + '"]:last'); $h = $headers.filter('[data-column="' + i + '"]:last');
if ($h.length) { if ($h.length) {
if ($h[0].sortDisabled) { if ($h[0].sortDisabled) {
// no sort arrows for disabled columns! // no sort arrows for disabled columns!