Skip to content

Commit 1e355c4

Browse files
authored
Merge pull request #4289 from Laravel-Backpack/fix-reponsive-table-header
Fix table header when not responsive
2 parents ea67fe5 + 03025f4 commit 1e355c4

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

src/public/packages/backpack/base/css/blue-bundle.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/packages/backpack/base/css/bundle.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/assets/scss/customs/_list.scss

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
}
9191

9292
&[data-has-bulk-actions="1"] {
93-
.has-hidden-columns {
93+
&.has-hidden-columns {
9494
thead tr th:first-child,
9595
tfoot tr th:first-child {
9696
padding-left: 1.35rem !important;
@@ -112,6 +112,23 @@
112112
}
113113
}
114114

115+
&[data-has-bulk-actions="0"] {
116+
&[data-has-details-row="1"],
117+
&.has-hidden-columns {
118+
thead tr th:first-child,
119+
tfoot tr th:first-child {
120+
padding-left: 1.8rem !important;
121+
}
122+
}
123+
124+
&[data-has-details-row="1"].has-hidden-columns {
125+
thead tr th:first-child,
126+
tfoot tr th:first-child {
127+
padding-left: 3rem !important;
128+
}
129+
}
130+
}
131+
115132
.details-control {
116133
display: flex;
117134
}
@@ -139,6 +156,13 @@
139156
padding-bottom: 1rem !important;
140157
padding-left: 0.6rem !important;
141158
}
159+
160+
&[data-responsive="0"] {
161+
tr th:first-child {
162+
padding-top: 0 !important;
163+
padding-bottom: 0 !important;
164+
}
165+
}
142166

143167
&[data-has-bulk-actions="0"] .details-control,
144168
&[data-has-bulk-actions="0"][data-has-details-row="0"] .dtr-control:before {

src/resources/views/crud/list.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
<table
5151
id="crudTable"
5252
class="bg-white table table-striped table-hover nowrap rounded shadow-xs border-xs mt-2"
53-
data-has-details-row="{{ $crud->getOperationSetting('detailsRow') ?? 0 }}"
54-
data-has-bulk-actions="{{ $crud->getOperationSetting('bulkActions') ?? 0 }}"
53+
data-responsive="{{ (int) $crud->getOperationSetting('responsiveTable') }}"
54+
data-has-details-row="{{ (int) $crud->getOperationSetting('detailsRow') }}"
55+
data-has-bulk-actions="{{ (int) $crud->getOperationSetting('bulkActions') }}"
5556
cellspacing="0">
5657
<thead>
5758
<tr>

0 commit comments

Comments
 (0)