File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/resources/views/crud/columns/inc Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,14 @@ function addOrRemoveCrudCheckedItem(element) {
2828 // if shift has been pressed, also select all elements
2929 // between the last checked item and this one
3030 if (crud .lastCheckedItem && e .shiftKey ) {
31+ let getNodeindex = elm => [... elm .parentNode .children ].indexOf (elm);
3132 let first = document .querySelector (` input.crud_bulk_actions_line_checkbox[data-primary-key-value="${ crud .lastCheckedItem } "]` ).closest (' tr' );
32- let end = document .querySelector (` input.crud_bulk_actions_line_checkbox[data-primary-key-value="${ primaryKeyValue} "]` ).closest (' tr' );
33-
34- while (first !== end) {
35- first = first .nextElementSibling ;
33+ let last = document .querySelector (` input.crud_bulk_actions_line_checkbox[data-primary-key-value="${ primaryKeyValue} "]` ).closest (' tr' );
34+ let firstIndex = getNodeindex (first);
35+ let lastIndex = getNodeindex (last)
36+
37+ while (first !== last) {
38+ first = firstIndex < lastIndex ? first .nextElementSibling : first .previousElementSibling ;
3639 first .querySelector (' input.crud_bulk_actions_line_checkbox:not(:checked)' )? .click ();
3740 }
3841 }
You can’t perform that action at this time.
0 commit comments