Skip to content

Commit

Permalink
Simplified submit button finding and undone unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored and Pavel Janda committed Sep 13, 2021
1 parent 70d1048 commit b596cf0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions assets/datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,10 @@ document.addEventListener('change', function(e) {
var buttons, checked_inputs, counter, event, grid, i, ie, input, inputs, len, results, select, total;
grid = e.target.getAttribute('data-check');
if (grid) {
var selector = '.datagrid-' + grid + ' .row-group-actions';
checked_inputs = document.querySelectorAll('input[data-check-all-' + grid + ']:checked');
select = document.querySelector(selector + ' select[name="group_action[group_action]"]');
buttons = document.querySelectorAll(selector + ' input[type="submit"], ' + selector + ' button[type="submit"]');
counter = document.querySelector(selector + ' .datagrid-selected-rows-count');
select = document.querySelector('.datagrid-' + grid + ' select[name="group_action[group_action]"]');
buttons = document.querySelectorAll('.datagrid-' + grid + ' .row-group-actions *[type="submit"]');
counter = document.querySelector('.datagrid-' + grid + ' .datagrid-selected-rows-count');

if (checked_inputs.length) {
if (buttons) {
Expand Down

0 comments on commit b596cf0

Please sign in to comment.