Skip to content

Commit

Permalink
Set table overflow only for the actual overflowing table (#22824)
Browse files Browse the repository at this point in the history
  • Loading branch information
mneudert authored Dec 4, 2024
1 parent 965cba5 commit 81a7802
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/CoreHome/javascripts/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,13 @@ $.extend(DataTable.prototype, UIControl.prototype, {
enableStickHead: function (domElem) {
var resizeTimeout = null;
var resize = function(domElem) {
var tableScrollerWidth = $(domElem).find('.dataTableScroller').width();
var tableScroller = $(domElem).find('.dataTableScroller');
var tableScrollerWidth = tableScroller.width();
var tableWidth = $(domElem).find('table').width();
if (tableScrollerWidth < tableWidth) {
$('.dataTableScroller').css('overflow-x', 'scroll');
tableScroller.css('overflow-x', 'scroll');
} else {
$('.dataTableScroller').css('overflow-x', '');
tableScroller.css('overflow-x', '');
}
};
// Bind to the resize event of the window object
Expand Down

0 comments on commit 81a7802

Please sign in to comment.