Skip to content

Commit

Permalink
21a716b9ea8cb4262c8dab39e9cb28e3337711e3 Dev: Correcting checks for a…
Browse files Browse the repository at this point in the history
…ppling a minWidth

Sync to source repo @21a716b9ea8cb4262c8dab39e9cb28e3337711e3
  • Loading branch information
dtbuild committed Oct 16, 2024
1 parent 7336100 commit 7e04a80
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.1.8",
"last-sync": "3ae6f7f30c6119f2a47d57095ab6fef609d0c19a"
"last-sync": "21a716b9ea8cb4262c8dab39e9cb28e3337711e3"
}
13 changes: 3 additions & 10 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -5252,17 +5252,10 @@

if (firstTr) {
var colSizes = $(firstTr).children('th, td').map(function (vis) {
var outerWidth = $(this).outerWidth();
var ret = {
return {
idx: _fnVisibleToColumnIndex(settings, vis),
width: outerWidth
width: $(this).outerWidth()
};

if (scrollX) {
ret.minWidth = outerWidth;
}

return ret;
});

// Check against what the colgroup > col is set to and correct if needed
Expand All @@ -5273,7 +5266,7 @@
if (colWidth !== colSizes[i].width) {
colEl.style.width = colSizes[i].width + 'px';

if (scrollX) {
if (scroll.sX) {
colEl.style.minWidth = colSizes[i].width + 'px';
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

13 changes: 3 additions & 10 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5199,17 +5199,10 @@ function _fnScrollDraw ( settings )

if (firstTr) {
var colSizes = $(firstTr).children('th, td').map(function (vis) {
var outerWidth = $(this).outerWidth();
var ret = {
return {
idx: _fnVisibleToColumnIndex(settings, vis),
width: outerWidth
width: $(this).outerWidth()
};

if (scrollX) {
ret.minWidth = outerWidth;
}

return ret;
});

// Check against what the colgroup > col is set to and correct if needed
Expand All @@ -5220,7 +5213,7 @@ function _fnScrollDraw ( settings )
if (colWidth !== colSizes[i].width) {
colEl.style.width = colSizes[i].width + 'px';

if (scrollX) {
if (scroll.sX) {
colEl.style.minWidth = colSizes[i].width + 'px';
}
}
Expand Down

0 comments on commit 7e04a80

Please sign in to comment.