Skip to content

Commit 9b03fd6

Browse files
committed
fix #4188 - bulk actions in safari
1 parent 8a2d927 commit 9b03fd6

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/resources/views/crud/columns/inc/bulk_actions_checkbox.blade.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ function addOrRemoveCrudCheckedItem(element) {
4949
enableOrDisableBulkButtons();
5050
});
5151
}
52-
53-
// activate checkbox if the page reloaded and the item is remembered as selected
54-
// make it so that the function above is run after each DataTable draw event
55-
crud.addFunctionToDataTablesDrawEventQueue('addOrRemoveCrudCheckedItem');
5652
}
5753
5854
if (typeof markCheckboxAsCheckedIfPreviouslySelected !== 'function') {
@@ -61,10 +57,6 @@ function markCheckboxAsCheckedIfPreviouslySelected() {
6157
.querySelectorAll('input.crud_bulk_actions_line_checkbox[data-primary-key-value]')
6258
.forEach(elem => elem.checked = crud.checkedItems?.length && crud.checkedItems.indexOf(elem.dataset.primaryKeyValue) > -1);
6359
}
64-
65-
// activate checkbox if the page reloaded and the item is remembered as selected
66-
// make it so that the function above is run after each DataTable draw event
67-
crud.addFunctionToDataTablesDrawEventQueue('markCheckboxAsCheckedIfPreviouslySelected');
6860
}
6961
7062
if (typeof addBulkActionMainCheckboxesFunctionality !== 'function') {
@@ -90,19 +82,18 @@ function addBulkActionMainCheckboxesFunctionality() {
9082
// Stop propagation of href on the first column
9183
document.querySelectorAll('table td.dtr-control a').forEach(link => link.onclick = e => e.stopPropagation());
9284
}
93-
94-
// run this function on DataTable draw event
95-
crud.addFunctionToDataTablesDrawEventQueue('addBulkActionMainCheckboxesFunctionality');
9685
}
9786
9887
if (typeof enableOrDisableBulkButtons !== 'function') {
9988
function enableOrDisableBulkButtons() {
10089
document.querySelectorAll('.bulk-button').forEach(btn => btn.classList.toggle('disabled', !crud.checkedItems?.length));
10190
}
102-
103-
// run this function on DataTable draw event
104-
crud.addFunctionToDataTablesDrawEventQueue('enableOrDisableBulkButtons');
10591
}
92+
93+
crud.addFunctionToDataTablesDrawEventQueue('addOrRemoveCrudCheckedItem');
94+
crud.addFunctionToDataTablesDrawEventQueue('markCheckboxAsCheckedIfPreviouslySelected');
95+
crud.addFunctionToDataTablesDrawEventQueue('addBulkActionMainCheckboxesFunctionality');
96+
crud.addFunctionToDataTablesDrawEventQueue('enableOrDisableBulkButtons');
10697
</script>
10798
@endLoadOnce
108-
@endif
99+
@endif

0 commit comments

Comments
 (0)