Skip to content

Commit 4d8c2ee

Browse files
author
dtbuild
committed
ec69cb56b909e9f6807d35b846cc8b3dd69c5efd Fix: Don't append span.dt-column-order to header rows / cells with data-dt-order=disable.
a643c14888287e8ecbbebe64e55fa05f142320db Build: Update to latest BS5 and Bulma 355a8d9e135df81b7cfecc53e2c25009603fd032 Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @355a8d9e135df81b7cfecc53e2c25009603fd032
1 parent df242e6 commit 4d8c2ee

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

datatables.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
],
1212
"src-repo": "http://github.com/DataTables/DataTablesSrc",
1313
"last-tag": "2.2.2",
14-
"last-sync": "312094f9065d6755f52ca20bc1a2b540d274116e"
14+
"last-sync": "355a8d9e135df81b7cfecc53e2c25009603fd032"
1515
}

js/dataTables.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3986,6 +3986,7 @@
39863986
cell.nodeName.toUpperCase() == 'TH'
39873987
) {
39883988
var cols = [];
3989+
var jqCell = $(cell);
39893990

39903991
// Get the col and rowspan attributes from the DOM and sanitise them
39913992
colspan = cell.getAttribute('colspan') * 1;
@@ -4006,7 +4007,7 @@
40064007
if ( write ) {
40074008
if (unique) {
40084009
// Allow column options to be set from HTML attributes
4009-
_fnColumnOptions( settings, shifted, $(cell).data() );
4010+
_fnColumnOptions( settings, shifted, jqCell.data() );
40104011

40114012
// Get the width for the column. This can be defined from the
40124013
// width attribute, style attribute or `columns.width` option
@@ -4048,12 +4049,12 @@
40484049
// Fall back to the aria-label attribute on the table header if no ariaTitle is
40494050
// provided.
40504051
if (! columnDef.ariaTitle) {
4051-
columnDef.ariaTitle = $(cell).attr("aria-label") || columnDef.sTitle;
4052+
columnDef.ariaTitle = jqCell.attr("aria-label") || columnDef.sTitle;
40524053
}
40534054

40544055
// Column specific class names
40554056
if ( columnDef.className ) {
4056-
$(cell).addClass( columnDef.className );
4057+
jqCell.addClass( columnDef.className );
40574058
}
40584059
}
40594060

@@ -4068,6 +4069,8 @@
40684069
if (
40694070
settings.orderIndicators &&
40704071
isHeader &&
4072+
jqCell.filter(':not([data-dt-order=disable])').length !== 0 &&
4073+
jqCell.parent(':not([data-dt-order=disable])').length !== 0 &&
40714074
$('span.dt-column-order', cell).length === 0
40724075
) {
40734076
$('<span>')

js/dataTables.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dataTables.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

js/dataTables.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,6 +3951,7 @@ function _fnDetectHeader ( settings, thead, write )
39513951
cell.nodeName.toUpperCase() == 'TH'
39523952
) {
39533953
var cols = [];
3954+
var jqCell = $(cell);
39543955

39553956
// Get the col and rowspan attributes from the DOM and sanitise them
39563957
colspan = cell.getAttribute('colspan') * 1;
@@ -3971,7 +3972,7 @@ function _fnDetectHeader ( settings, thead, write )
39713972
if ( write ) {
39723973
if (unique) {
39733974
// Allow column options to be set from HTML attributes
3974-
_fnColumnOptions( settings, shifted, $(cell).data() );
3975+
_fnColumnOptions( settings, shifted, jqCell.data() );
39753976

39763977
// Get the width for the column. This can be defined from the
39773978
// width attribute, style attribute or `columns.width` option
@@ -4013,12 +4014,12 @@ function _fnDetectHeader ( settings, thead, write )
40134014
// Fall back to the aria-label attribute on the table header if no ariaTitle is
40144015
// provided.
40154016
if (! columnDef.ariaTitle) {
4016-
columnDef.ariaTitle = $(cell).attr("aria-label") || columnDef.sTitle;
4017+
columnDef.ariaTitle = jqCell.attr("aria-label") || columnDef.sTitle;
40174018
}
40184019

40194020
// Column specific class names
40204021
if ( columnDef.className ) {
4021-
$(cell).addClass( columnDef.className );
4022+
jqCell.addClass( columnDef.className );
40224023
}
40234024
}
40244025

@@ -4033,6 +4034,8 @@ function _fnDetectHeader ( settings, thead, write )
40334034
if (
40344035
settings.orderIndicators &&
40354036
isHeader &&
4037+
jqCell.filter(':not([data-dt-order=disable])').length !== 0 &&
4038+
jqCell.parent(':not([data-dt-order=disable])').length !== 0 &&
40364039
$('span.dt-column-order', cell).length === 0
40374040
) {
40384041
$('<span>')

0 commit comments

Comments
 (0)