Skip to content

Commit

Permalink
fix sticky thead horizontal scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
sergolius committed Mar 6, 2021
1 parent 88ce30f commit 0c6418b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions views/assets/javascripts/qor/qor-fixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@
scrollTop = this.$content.scrollTop(),
offsetTop = this.$subHeader.outerHeight() + this.paddingHeight + this.marginBottomPX,
headerHeight = $('.qor-page__header').outerHeight(),
pageTop = this.$content.offset().top + $(CLASS_HEADER).height();
pageTop = this.$content.offset().top + $(CLASS_HEADER).height(),
tableLeft = $element.offset().left;

if (scrollTop > offsetTop - headerHeight) {
$thead.css({top: pageTop});
$thead.css({top: pageTop, left: tableLeft});
$element.addClass(CLASS_FIXED_TABLE);
} else {
$thead.css({top: 0});
$thead.css({top: 0, left: 0});
$element.removeClass(CLASS_FIXED_TABLE);
}
},
Expand Down

0 comments on commit 0c6418b

Please sign in to comment.