Skip to content

Commit

Permalink
Merge pull request #82 from clyfe/master
Browse files Browse the repository at this point in the history
Fix header not disappearing after table out of view
  • Loading branch information
mkoryak committed Apr 28, 2014
2 parents 5c82ad5 + 3280ea3 commit 73b8bf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
}
var top, left, tableHeight;

tableHeight = $table.outerHeight();
if(locked && useAbsolutePositioning){ //inner scrolling, absolute positioning
if (tableContainerGap >= scrollingContainerTop) {
var gap = tableContainerGap - scrollingContainerTop;
Expand All @@ -504,7 +505,6 @@
}
left = 0;
} else if(!locked && useAbsolutePositioning) { //window scrolling, absolute positioning
tableHeight = $table.outerHeight();
if(windowTop > floatEnd + tableHeight + captionScrollOffset){
top = tableHeight - floatContainerHeight + captionScrollOffset; //scrolled past table
} else if (tableOffset.top > windowTop + scrollingTop) {
Expand All @@ -516,7 +516,7 @@
}
left = 0;
} else if(locked && !useAbsolutePositioning){ //inner scrolling, fixed positioning
if (tableContainerGap > scrollingContainerTop) {
if (tableContainerGap > scrollingContainerTop || scrollingContainerTop - tableContainerGap > tableHeight) {
top = tableOffset.top - windowTop;
unfloat();
} else {
Expand Down Expand Up @@ -692,4 +692,4 @@
});
return this;
};
})(jQuery);
})(jQuery);

0 comments on commit 73b8bf0

Please sign in to comment.