From 284b017c8a185f3fb719cbcc7a132bcd90739a82 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Sun, 26 Apr 2026 18:46:37 +0200 Subject: [PATCH] Objects list: Fix table header sorting indicators displayed in double --- js/dataTables.tree-grouping.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/js/dataTables.tree-grouping.js b/js/dataTables.tree-grouping.js index bfb33aa02d..bebe88e379 100644 --- a/js/dataTables.tree-grouping.js +++ b/js/dataTables.tree-grouping.js @@ -37,11 +37,11 @@ var iTopDataTableExternalKeyGrouping = (function ($) { '.ibo-datatable--tree-spacer {' + ' display: inline-block;' + '}' + - 'th.ibo-datatable--tree-sortable {' + + '.dataTables_scrollHead th.ibo-datatable--tree-sortable {' + ' cursor: pointer;' + ' user-select: none;' + '}' + - 'th.ibo-datatable--tree-sortable::after {' + + '.dataTables_scrollHead th.ibo-datatable--tree-sortable::after {' + ' font-family: "Font Awesome 5 Free";' + ' font-weight: 900;' + ' content: "\\f0dc";' + @@ -49,13 +49,19 @@ var iTopDataTableExternalKeyGrouping = (function ($) { ' opacity: 0.4;' + ' font-size: 0.85em;' + '}' + - 'th.ibo-datatable--tree-sort-asc::after {' + + '.dataTables_scrollHead th.ibo-datatable--tree-sort-asc::after {' + ' content: "\\f0de";' + ' opacity: 1;' + '}' + - 'th.ibo-datatable--tree-sort-desc::after {' + + '.dataTables_scrollHead th.ibo-datatable--tree-sort-desc::after {' + ' content: "\\f0dd";' + ' opacity: 1;' + + '}' + + /* Suppress ::after on the minimised thead clone that DataTables injects + into scrollBody on every draw — it copies scrollHead classes verbatim, + so our sort-icon classes would show there too without this rule. */ + '.dataTables_scrollBody thead th::after {' + + ' display: none !important;' + '}' ) .appendTo('head'); @@ -240,9 +246,6 @@ var iTopDataTableExternalKeyGrouping = (function ($) { oDt.clear(); oDt.rows.add(aVisible); oDt.draw(false); - // DataTables leaves the scrollBody visible in non-paged client-side mode; - // hide it to prevent a phantom header row with duplicate sort icons. - $('#' + sTableId).closest('.dataTables_scrollBody').find('thead').css('visibility', 'hidden'); } // ── Add indent spacer + toggle button to the first cell of each row ───────