Modify select panel visibility

Make the select panel always visible because several user reports suggest that they are unaware of the feature.
Also solves the minor issue that selecting/deselecting a single row changes the position of the table which makes it prone to misclicks.
This commit is contained in:
d-buchmann 2025-08-13 11:57:00 +02:00
parent 23cd51c1ca
commit afbd373088
2 changed files with 6 additions and 6 deletions

View file

@ -42,11 +42,11 @@ export default class extends DatatablesController {
const selectPanel = this.selectPanelTarget;
//Hide/Unhide panel with the selection tools
//Toggle action button based on selection
if (count > 0) {
selectPanel.classList.remove('d-none');
document.getElementById("selectPanel_submit").disabled = false;
} else {
selectPanel.classList.add('d-none');
document.getElementById("selectPanel_submit").disabled = true;
}
//Update selection count text

View file

@ -29,14 +29,14 @@
<input type="hidden" name="ids" {{ stimulus_target('elements/datatables/parts', 'selectIDs') }} value="">
<div class="d-none mb-2" {{ stimulus_target('elements/datatables/parts', 'selectPanel') }}>
<div class="mb-2" {{ stimulus_target('elements/datatables/parts', 'selectPanel') }}>
{# <span id="select_count"></span> #}
<div class="input-group">
<button class="btn btn-outline-secondary" type="button" {{ stimulus_action('elements/datatables/parts', 'invertSelection')}}
title="{% trans %}part_list.action.invert_selection{% endtrans %}" ><i class="fa-solid fa-arrow-right-arrow-left"></i></button>
<span class="input-group-text">
<span class="badge bg-primary">{% trans with {'%count%': '<span ' ~ stimulus_target('elements/datatables/parts', 'selectCount') ~ '></span>'} %}part_list.action.part_count{% endtrans %}</span>
<span class="badge bg-primary">{% trans with {'%count%': '<span ' ~ stimulus_target('elements/datatables/parts', 'selectCount') ~ '>0</span>'} %}part_list.action.part_count{% endtrans %}</span>
</span>
<select class="form-select" name="action" data-controller="elements--select" {{ stimulus_action('elements/datatables/parts', 'updateTargetPicker', 'change') }}
@ -79,7 +79,7 @@
{# This is left empty, as this will be filled by Javascript #}
</select>
<button type="submit" class="btn btn-primary">{% trans %}part_list.action.submit{% endtrans %}</button>
<button id="selectPanel_submit" disabled type="submit" class="btn btn-primary">{% trans %}part_list.action.submit{% endtrans %}</button>
</div>
</div>