Skip to content

Commit

Permalink
38ba1ccc45f04b483c0aaf7f0c74d7b9f7d016af Fix: Processing indicator, w…
Browse files Browse the repository at this point in the history
…hen scrolling is enabled, could be partly hidden under the header / footer elements

https://datatables.net/forums/discussion/78854

Sync to source repo @38ba1ccc45f04b483c0aaf7f0c74d7b9f7d016af
  • Loading branch information
dtbuild committed Apr 29, 2024
1 parent bbc78d7 commit c839627
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 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.0.5",
"last-sync": "ba5e121e7fc4bdae642179fe79e3c76de9a41619"
"last-sync": "38ba1ccc45f04b483c0aaf7f0c74d7b9f7d016af"
}
14 changes: 11 additions & 3 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -4817,6 +4817,7 @@
function _processingHtml ( settings )
{
var table = settings.nTable;
var scrolling = settings.oScroll.sX !== '' || settings.oScroll.sY !== '';

if ( settings.oFeatures.bProcessing ) {
var n = $('<div/>', {
Expand All @@ -4825,9 +4826,16 @@
'role': 'status'
} )
.html( settings.oLanguage.sProcessing )
.append('<div><div></div><div></div><div></div><div></div></div>')
.insertBefore( table );

.append('<div><div></div><div></div><div></div><div></div></div>');

// Different positioning depending on if scrolling is enabled or not
if (scrolling) {
n.prependTo( 'div.dt-scroll', settings.nTableWrapper );
}
else {
n.insertBefore( table );
}

$(table).on( 'processing.dt.DT', function (e, s, show) {
n.css( 'display', show ? 'block' : 'none' );
} );
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.

14 changes: 11 additions & 3 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4764,6 +4764,7 @@ function _fnPageChange ( settings, action, redraw )
function _processingHtml ( settings )
{
var table = settings.nTable;
var scrolling = settings.oScroll.sX !== '' || settings.oScroll.sY !== '';

if ( settings.oFeatures.bProcessing ) {
var n = $('<div/>', {
Expand All @@ -4772,9 +4773,16 @@ function _processingHtml ( settings )
'role': 'status'
} )
.html( settings.oLanguage.sProcessing )
.append('<div><div></div><div></div><div></div><div></div></div>')
.insertBefore( table );

.append('<div><div></div><div></div><div></div><div></div></div>');

// Different positioning depending on if scrolling is enabled or not
if (scrolling) {
n.prependTo( 'div.dt-scroll', settings.nTableWrapper );
}
else {
n.insertBefore( table );
}

$(table).on( 'processing.dt.DT', function (e, s, show) {
n.css( 'display', show ? 'block' : 'none' );
} );
Expand Down

0 comments on commit c839627

Please sign in to comment.