Skip to content

Commit e81c847

Browse files
committed
Made part table action bar sticky floating
Related to PR #997
1 parent ecd2abe commit e81c847

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

assets/controllers/elements/datatables/parts_controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ export default class extends DatatablesController {
4545
//Hide/Unhide panel with the selection tools
4646
if (count > 0) {
4747
selectPanel.classList.remove('d-none');
48+
selectPanel.classList.add('sticky-select-bar');
4849
} else {
4950
selectPanel.classList.add('d-none');
51+
selectPanel.classList.remove('sticky-select-bar');
5052
}
5153

5254
//Update selection count text

assets/css/app/tables.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919

20+
/****************************************
21+
* Action bar
22+
****************************************/
23+
24+
.sticky-select-bar {
25+
position: sticky;
26+
top: 120px;
27+
z-index: 3000; /* Ensure the bar is above other content */
28+
}
29+
2030
/****************************************
2131
* Tables
2232
****************************************/
@@ -109,4 +119,4 @@ Classes for Datatables export
109119
#export-messageTop,
110120
.export-helper{
111121
display: none;
112-
}
122+
}

templates/components/datatables.macro.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<input type="hidden" name="ids" {{ stimulus_target('elements/datatables/parts', 'selectIDs') }} value="">
3131

32-
<div class="d-none mb-2" {{ stimulus_target('elements/datatables/parts', 'selectPanel') }}>
32+
<div class="d-none mb-2 bg-body-secondary shadow-sm border border-secondary rounded mx-2 p-2" {{ stimulus_target('elements/datatables/parts', 'selectPanel') }}>
3333
{# <span id="select_count"></span> #}
3434

3535
<div class="input-group">
@@ -95,4 +95,4 @@
9595
</div>
9696
</form>
9797

98-
{% endmacro %}
98+
{% endmacro %}

0 commit comments

Comments
 (0)