Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#100 inner scrolling doesnt respect container border width #185

Merged
merged 1 commit into from Apr 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions dist/jquery.floatThead-slim.js
Expand Up @@ -537,14 +537,16 @@
var floatContainerHeight = $floatContainer.height();
var tableOffset = $table.offset();
var tableLeftGap = 0; //can be caused by border on container (only in locked mode)
var tableTopGap = 0;
if(locked){
var containerOffset = $scrollContainer.offset();
tableContainerGap = tableOffset.top - containerOffset.top + scrollingContainerTop;
if(haveCaption && captionAlignTop){
tableContainerGap += captionHeight;
}
tableContainerGap -= floatContainerBorderWidth('top');
tableLeftGap = floatContainerBorderWidth('left');
tableTopGap = floatContainerBorderWidth('top');
tableContainerGap -= tableTopGap;
} else {
floatEnd = tableOffset.top - scrollingTop - floatContainerHeight + scrollingBottom + scrollbarOffset.horizontal;
}
Expand Down Expand Up @@ -603,11 +605,11 @@

if(locked && useAbsolutePositioning){ //inner scrolling, absolute positioning
if (tableContainerGap >= scrollingContainerTop) {
var gap = tableContainerGap - scrollingContainerTop;
var gap = tableContainerGap - scrollingContainerTop + tableTopGap;
top = gap > 0 ? gap : 0;
triggerFloatEvent(false);
} else {
top = wrappedContainer ? 0 : scrollingContainerTop;
top = wrappedContainer ? tableTopGap : scrollingContainerTop;
//headers stop at the top of the viewport
triggerFloatEvent(true);
}
Expand Down