Resizable: Adjust handle position for jQuery v3.3.0+

This commit is contained in:
Rob Garrison 2018-04-26 14:05:55 -05:00
parent 2b5812e308
commit 08d6c58105
2 changed files with 10 additions and 1 deletions

View File

@ -53,6 +53,14 @@
min-width: 10px; min-width: 10px;
}</style> }</style>
<style>
/* test resizable handle positioning
.tablesorter-resizable-handle {
background: rgba(255, 0, 0, .4)
}
*/
</style>
<script id="js">$(function() { <script id="js">$(function() {
$('.narrow-table').tablesorter({ $('.narrow-table').tablesorter({

View File

@ -168,7 +168,8 @@
tableHeight -= c.$table.children('tfoot').height(); tableHeight -= c.$table.children('tfoot').height();
} }
// subtract out table left position from resizable handles. Fixes #864 // subtract out table left position from resizable handles. Fixes #864
startPosition = c.$table.position().left; // jQuery v3.3.0+ appears to include the start position with the $header.position().left; see #1544
startPosition = parseFloat($.fn.jquery) >= 3.3 ? 0 : c.$table.position().left;
$handles.each( function() { $handles.each( function() {
var $this = $(this), var $this = $(this),
column = parseInt( $this.attr( 'data-column' ), 10 ), column = parseInt( $this.attr( 'data-column' ), 10 ),