Skip to content

Commit

Permalink
fixes #128
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoryak committed Oct 15, 2014
1 parent e0bb475 commit caa6ff3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions dist/jquery.floatThead-slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@
function setFloatWidth(){
var tableWidth = $table.outerWidth();
var width = $scrollContainer.width() || tableWidth;
$floatContainer.width(width - scrollbarOffset.vertical);
var floatContainerWidth = $scrollContainer.css("overflow-y") != 'hidden' ? width - scrollbarOffset.vertical : width;
$floatContainer.width(floatContainerWidth);
if(locked){
var percent = 100 * tableWidth / (width - scrollbarOffset.vertical);
var percent = 100 * tableWidth / (floatContainerWidth);
$floatTable.css('width', percent+'%');
} else {
$floatTable.outerWidth(tableWidth);
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.floatThead-slim.min.js

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

6 changes: 3 additions & 3 deletions dist/jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@
function setFloatWidth(){
var tableWidth = $table.outerWidth();
var width = $scrollContainer.width() || tableWidth;
var noOffsetWidth = ($scrollContainer.css("overflow-y") != 'hidden')?width - scrollbarOffset.vertical:width;
$floatContainer.width(noOffsetWidth);
var floatContainerWidth = $scrollContainer.css("overflow-y") != 'hidden' ? width - scrollbarOffset.vertical : width;
$floatContainer.width(floatContainerWidth);
if(locked){
var percent = 100 * tableWidth / (noOffsetWidth);
var percent = 100 * tableWidth / (floatContainerWidth);
$floatTable.css('width', percent+'%');
} else {
$floatTable.outerWidth(tableWidth);
Expand Down
Loading

0 comments on commit caa6ff3

Please sign in to comment.