Skip to content

Commit 70e1775

Browse files
committed
rename settings
1 parent 62969bc commit 70e1775

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/config/backpack/operations/list.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
// What is the minimum actions for the dropdown to be created
5353
// Example: when minimum to drop is «2», any row with less than «2» action buttons
5454
// will not create a dropdown, but will show the buttons inline
55-
'lineButtonsAsDropdownMinimumToDrop' => 1,
55+
'lineButtonsAsDropdownMinimum' => 1,
5656

5757
// Force «X» actions to be shown inline before the dropdown is created
5858
// Example: when setting this to «2», the first «2» actions will be shown inline
5959
// and the rest will be moved to the dropdown
60-
'lineButtonsAsDropdownDropAfter' => 0,
60+
'lineButtonsAsDropdownShowBefore' => 0,
6161

6262
// Show a "Reset" button next to the List operation subheading
6363
// (Showing 1 to 25 of 9999 entries. Reset)

src/resources/views/crud/inc/datatables_logic.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,17 +407,17 @@ function formatActionColumnAsDropdown() {
407407
const actionColumnIndex = $('#crudTable').find('th[data-action-column=true]').index();
408408
if (actionColumnIndex === -1) return;
409409
410-
const minimumToDrop = $('#crudTable').data('line-buttons-as-dropdown-minimum-to-drop');
411-
const dropAfter = $('#crudTable').data('line-buttons-as-dropdown-drop-after');
410+
const minimumButtonsToBuildDropdown = $('#crudTable').data('line-buttons-as-dropdown-minimum');
411+
const buttonsToShowBeforeDropdown = $('#crudTable').data('line-buttons-as-dropdown-show-before-dropdown');
412412
413413
$('#crudTable tbody tr').each(function (i, tr) {
414414
const actionCell = $(tr).find('td').eq(actionColumnIndex);
415415
const actionButtons = actionCell.find('a.btn.btn-link');
416416
if (actionCell.find('.actions-buttons-column').length) return;
417-
if (actionButtons.length < minimumToDrop) return;
417+
if (actionButtons.length < minimumButtonsToBuildDropdown) return;
418418
419419
// Prepare buttons as dropdown items
420-
const dropdownItems = actionButtons.slice(dropAfter).map((index, action) => {
420+
const dropdownItems = actionButtons.slice(buttonsToShowBeforeDropdown).map((index, action) => {
421421
$(action).addClass('dropdown-item').removeClass('btn btn-sm btn-link');
422422
$(action).find('i').addClass('me-2 text-primary');
423423
return action;
@@ -432,7 +432,7 @@ function formatActionColumnAsDropdown() {
432432
actionCell.prepend('<a class="btn btn-sm px-2 py-1 btn-outline-primary dropdown-toggle actions-buttons-column" href="#" data-toggle="dropdown" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">{{ trans('backpack::crud.actions') }}</a>');
433433
434434
// Move the remaining buttons outside the dropdown
435-
const remainingButtons = actionButtons.slice(0, dropAfter);
435+
const remainingButtons = actionButtons.slice(0, buttonsToShowBeforeDropdown);
436436
actionCell.prepend(remainingButtons);
437437
}
438438
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class="{{ backpack_theme_config('classes.table') ?? 'table table-striped table-h
6262
data-has-details-row="{{ (int) $crud->getOperationSetting('detailsRow') }}"
6363
data-has-bulk-actions="{{ (int) $crud->getOperationSetting('bulkActions') }}"
6464
data-has-line-buttons-as-dropdown="{{ (int) $crud->getOperationSetting('lineButtonsAsDropdown') }}"
65-
data-line-buttons-as-dropdown-minimum-to-drop="{{ (int) $crud->getOperationSetting('lineButtonsAsDropdownMinimumToDrop') }}"
66-
data-line-buttons-as-dropdown-drop-after="{{ (int) $crud->getOperationSetting('lineButtonsAsDropdownDropAfter') }}"
65+
data-line-buttons-as-dropdown-minimum="{{ (int) $crud->getOperationSetting('lineButtonsAsDropdownMinimum') }}"
66+
data-line-buttons-as-dropdown-show-before-dropdown="{{ (int) $crud->getOperationSetting('lineButtonsAsDropdownShowBefore') }}"
6767
cellspacing="0">
6868
<thead>
6969
<tr>

0 commit comments

Comments
 (0)