Add caption styling to uitheme widget

This commit is contained in:
Mottie 2013-11-08 23:14:23 -06:00
parent bf733e0808
commit 954ddeb493
5 changed files with 10 additions and 4 deletions

View File

@ -62,7 +62,7 @@
}
/* caption */
caption {
.caption {
background: #fff;
}

View File

@ -79,8 +79,8 @@
}
/* caption */
caption {
background: #fff;
.tablesorter-jui caption {
border: 0;
}
/* filter widget */

View File

@ -120,6 +120,7 @@
<br>
<div id="demo"><table class="tablesorter">
<caption>Some interesting caption</caption>
<thead>
<tr>
<th>First Name</th>

View File

@ -313,7 +313,7 @@
<li><a href="example-widget-sticky-header.html">Sticky header widget</a> (v2.0.21.1; <span class="version updated">v2.10</span>)</li>
<li>UITheme widget:
<ul>
<li><a href="example-widget-ui-theme.html">jQuery UI theme</a> (v2.0.9; Modified v2.4)</li>
<li><a href="example-widget-ui-theme.html">jQuery UI theme</a> (v2.0.9; <span class="version updated">v2.13.3</span>)</li>
<li><a href="example-widget-bootstrap-theme.html">Bootstrap</a> (v2.4)</li>
</ul>
</li>

View File

@ -17,6 +17,7 @@ var ts = $.tablesorter = $.tablesorter || {};
ts.themes = {
"bootstrap" : {
table : 'table table-bordered table-striped',
caption : 'caption',
header : 'bootstrap-header', // give the header a gradient background
footerRow : '',
footerCells: '',
@ -32,6 +33,7 @@ ts.themes = {
},
"jui" : {
table : 'ui-widget ui-widget-content ui-corner-all', // table classes
caption : 'ui-widget-content ui-corner-all',
header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
footerRow : '',
footerCells: '',
@ -167,10 +169,13 @@ ts.addWidget({
sh = 'tr.' + (wo.stickyHeaders || 'tablesorter-stickyHeader'),
rmv = o.sortNone + ' ' + o.sortDesc + ' ' + o.sortAsc;
if (c.debug) { time = new Date(); }
// initialization code - run once
if (!$t.hasClass('tablesorter-' + theme) || c.theme === theme || !table.hasInitialized){
// update zebra stripes
if (o.even !== '') { wo.zebra[0] += ' ' + o.even; }
if (o.odd !== '') { wo.zebra[1] += ' ' + o.odd; }
// add caption style
$t.find('caption').addClass(o.caption);
// add table/footer class names
t = $t
// remove other selected themes; use widgetOptions.theme_remove