Skip to content

Commit

Permalink
fix: markmalek#138 width depending on vertical scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Toplak committed Mar 20, 2015
1 parent 663174a commit 4ebf88b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions jquery.fixedheadertable.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@
settings.scrollbarOffset = helpers._getScrollbarWidth();
settings.themeClassName = settings.themeClass;


if (settings.width.search('%') > -1) {
widthMinusScrollbar = $self.parent().width() - settings.scrollbarOffset;
widthMinusScrollbar = $self.parent().width();
} else {
widthMinusScrollbar = settings.width - settings.scrollbarOffset;
widthMinusScrollbar = settings.width;
}

if($self.height() > $self.parent().height()) {
widthMinusScrollbar -= settings.scrollbarOffset;
}

$self.css({
Expand Down
Loading

1 comment on commit 4ebf88b

@lusffs
Copy link

@lusffs lusffs commented on 4ebf88b May 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change.
Have you considered that the parent may not always have a max-height?
I check towards the settings value instead.

if ($self.height() >= parseInt(settings.height, 10)) {
   widthMinusScrollbar -= settings.scrollbarOffset;
}

Please sign in to comment.