From e81c8470beebd8f4665a6360981248239a0178b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 7 Sep 2025 21:51:58 +0200 Subject: [PATCH] Made part table action bar sticky floating Related to PR #997 --- .../elements/datatables/parts_controller.js | 2 ++ assets/css/app/tables.css | 12 +++++++++++- templates/components/datatables.macro.html.twig | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/controllers/elements/datatables/parts_controller.js b/assets/controllers/elements/datatables/parts_controller.js index 1fe11a20..c43fa276 100644 --- a/assets/controllers/elements/datatables/parts_controller.js +++ b/assets/controllers/elements/datatables/parts_controller.js @@ -45,8 +45,10 @@ export default class extends DatatablesController { //Hide/Unhide panel with the selection tools if (count > 0) { selectPanel.classList.remove('d-none'); + selectPanel.classList.add('sticky-select-bar'); } else { selectPanel.classList.add('d-none'); + selectPanel.classList.remove('sticky-select-bar'); } //Update selection count text diff --git a/assets/css/app/tables.css b/assets/css/app/tables.css index ae892f50..aa72fff3 100644 --- a/assets/css/app/tables.css +++ b/assets/css/app/tables.css @@ -17,6 +17,16 @@ * along with this program. If not, see . */ +/**************************************** + * Action bar + ****************************************/ + +.sticky-select-bar { + position: sticky; + top: 120px; + z-index: 3000; /* Ensure the bar is above other content */ +} + /**************************************** * Tables ****************************************/ @@ -109,4 +119,4 @@ Classes for Datatables export #export-messageTop, .export-helper{ display: none; -} \ No newline at end of file +} diff --git a/templates/components/datatables.macro.html.twig b/templates/components/datatables.macro.html.twig index 5ce0f23f..447aa69c 100644 --- a/templates/components/datatables.macro.html.twig +++ b/templates/components/datatables.macro.html.twig @@ -29,7 +29,7 @@ -
+
{# #}
@@ -95,4 +95,4 @@
-{% endmacro %} \ No newline at end of file +{% endmacro %}