Skip to content

Commit

Permalink
Resizable: Add resizable_includeFooter option. Fixes #1386
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Apr 14, 2017
1 parent 36986e1 commit caf9445
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/js/widgets/widget-resizable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions docs/example-widget-resizable.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,17 @@ <h4>Resizable widget defaults (added inside of tablesorter <code>widgetOptions</
</td>
</tr>

<tr id="resizable-include-footer">
<td><a href="#" class="permalink">resizable_includeFooter</a></td>
<td>true</td>
<td>When <code>true</code>, the resizable handle will extend into the table footer (<span class="version">v2.28.8</span>).
<div class="collapsible">
<p>When <code>true</code>, this option includes the entire height of the table footer. If the table does not include a footer, the resize handle will stop at the last row.</p>
<p>If <code>false</code>, the resizable handle will not extend into the table footer.</p>
</div>
</td>
</tr>

<tr id="resizable-widths">
<td><a href="#" class="permalink">resizable_widths</a></td>
<td>[ ]</td>
Expand Down Expand Up @@ -262,6 +273,16 @@ <h3>
<th>Date</th>
</tr>
</thead>
<tfoot>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Age</th>
<th>Total</th>
<th>Discount</th>
<th>Date</th>
</tr>
</tfoot>
<tbody>
<tr><td>Peter</td><td>Parker</td><td>28</td><td>$9.99</td><td>20%</td><td>Jul 6, 2006 8:14 AM</td></tr>
<tr><td>John</td><td>Hood</td><td>33</td><td>$19.99</td><td>25%</td><td>Dec 10, 2002 5:14 AM</td></tr>
Expand Down
21 changes: 19 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ <h4 id="extras">Plugins / Widgets<br>
<li><a href="example-widget-print.html">Print widget</a> (<span class="version">v2.16.4</span>; <span class="version updated">v2.25.8</span>).</li>
<li><a href="example-widget-reflow.html">Reflow widget</a> (<span class="version">v2.16</span>; <span class="version updated">v2.19.0</span>).</li>
<li><a href="example-widgets.html">Repeat headers widget</a> (v2.0.5; <span class="version updated">v2.19.0</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-resizable.html">Resizable columns widget</a> (v2.0.23.1; <span class="version updated">v2.28.5</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-resizable.html">Resizable columns widget</a> (v2.0.23.1; <span class="version updated">v2.28.8</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-savesort.html">Save sort widget</a> (v2.0.27; <span class="version updated">v2.24.0</span>).</li>
<li><a href="example-widget-scroller.html">Scroller widget</a> (<span class="version">v2.9</span>; <span class="version updated">v2.28.5</span>).</li>
<li><span class="label label-info">Beta</span> <a href="example-widget-sort-to-hash.html">Sort-to-hash widget</a> (<span class="version">v2.22.4</span>; <span class="version updated">v2.28.6</span>).</li>
Expand Down Expand Up @@ -2051,6 +2051,10 @@ <h4>Custom theme</h4>
// will be included in the last column of the table
resizable_addLastColumn: false,

// If this option is set to true, the resizable handle will extend
// into the table footer
resizable_includeFooter: true,

// Set this option to the starting & reset header widths
resizable_widths: [],

Expand Down Expand Up @@ -3854,6 +3858,19 @@ <h4>Comparison example</h4>
<td><a href="example-widget-resizable.html">Example</a></td>
</tr>

<tr id="widget-resizable-includefooter">
<td><a href="#" class="permalink">resizable_includeFooter</a></td>
<td>Boolean</td>
<td>true</td>
<td>Resizable widget: If this option is set to <code>true</code>, the resizable handle will extend into the table footer (<span class="version">v2.28.8</span>).
<div class="collapsible">
<p>When <code>true</code>, this option includes the entire height of the table footer. If the table does not include a footer, the resize handle will stop at the last row.</p>
<p>If <code>false</code>, the resizable handle will not extend into the table footer.</p>
</div>
</td>
<td></td>
</tr>

<tr id="widget-resizable-widths">
<td><a href="#" class="permalink">resizable_widths</a></td>
<td>Array</td>
Expand Down Expand Up @@ -3904,7 +3921,7 @@ <h4>Comparison example</h4>
<td></td>
</tr>

<tr id="resizable-target-last">
<tr id="widget-resizable-target-last">
<td><a href="#" class="permalink">resizable_targetLast</a></td>
<td>Boolean</td>
<td>false</td>
Expand Down
8 changes: 6 additions & 2 deletions js/widgets/widget-resizable.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@
tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
});
}

if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
tableHeight -= c.$table.children('tfoot').height();
}
// subtract out table left position from resizable handles. Fixes #864
startPosition = c.$table.position().left;
$handles.each( function() {
Expand Down Expand Up @@ -333,10 +337,10 @@
options: {
resizable : true, // save column widths to storage
resizable_addLastColumn : false,
resizable_includeFooter: true,
resizable_widths : [],
resizable_throttle : false, // set to true (5ms) or any number 0-10 range
resizable_targetLast : false,
resizable_fullWidth : null
resizable_targetLast : false
},
init: function(table, thisWidget, c, wo) {
ts.resizable.init( c, wo );
Expand Down

0 comments on commit caf9445

Please sign in to comment.