From e76c5c0145f1575254603ba507fbea339cfb4e82 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 31 Oct 2024 10:50:20 +0100 Subject: [PATCH] Bug 36640: Restore previous order sequence behaviour There was a behaviour change: https://datatables.net/upgrade/2#Order-sequence """ When ordering columns by clicking on their header element, in v1 it would simply toggle between ascending and descending ordering for the columns (controllable with the columns.orderSequence option). DataTables 2 introduces a new option to this parameter, an empty string value which represents no ordering. The default has been updated to make use of this and the ordering sequence that is applied when clicking the header cell is now: Ascending Descending No order It will repeat that sequence indefinitely as the column header is clicked. As before, it can be controlled using the columns.orderSequence option, and if you wish to restore the default DataTables 1.x behaviour you can do so by setting the default: DataTable.defaults.column.orderSequence = ['asc', 'desc']; """ This patch restore the behaviour we had before the upgrade. Signed-off-by: Jake Deery Signed-off-by: Lisette Scheer Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index be3cd4224d..4d8dbcec03 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -70,8 +70,9 @@ var dataTablesDefaults = { // _dt_add_delay(dt, table_node); // } //} - } + }, }; +DataTable.defaults.column.orderSequence = ['asc', 'desc']; function toggledClearFilter(searchText, tableId){ if( searchText == "" ){