mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-18 16:19:34 +00:00
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:
parent
23cd51c1ca
commit
afbd373088
2 changed files with 6 additions and 6 deletions
|
|
@ -42,11 +42,11 @@ export default class extends DatatablesController {
|
||||||
|
|
||||||
const selectPanel = this.selectPanelTarget;
|
const selectPanel = this.selectPanelTarget;
|
||||||
|
|
||||||
//Hide/Unhide panel with the selection tools
|
//Toggle action button based on selection
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
selectPanel.classList.remove('d-none');
|
document.getElementById("selectPanel_submit").disabled = false;
|
||||||
} else {
|
} else {
|
||||||
selectPanel.classList.add('d-none');
|
document.getElementById("selectPanel_submit").disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update selection count text
|
//Update selection count text
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@
|
||||||
|
|
||||||
<input type="hidden" name="ids" {{ stimulus_target('elements/datatables/parts', 'selectIDs') }} value="">
|
<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> #}
|
{# <span id="select_count"></span> #}
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<button class="btn btn-outline-secondary" type="button" {{ stimulus_action('elements/datatables/parts', 'invertSelection')}}
|
<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>
|
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="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>
|
</span>
|
||||||
|
|
||||||
<select class="form-select" name="action" data-controller="elements--select" {{ stimulus_action('elements/datatables/parts', 'updateTargetPicker', 'change') }}
|
<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 #}
|
{# This is left empty, as this will be filled by Javascript #}
|
||||||
</select>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue