Commit 8eb8b688 authored by aq1's avatar aq1 Committed by GitHub

Update actions.js



Create function to toggle row checkbox if all checkboxes were toggled manually
parent 4348d60b
...@@ -33,4 +33,18 @@ var AdminModelActions = function(actionErrorMessage, actionConfirmations) { ...@@ -33,4 +33,18 @@ var AdminModelActions = function(actionErrorMessage, actionConfirmations) {
$('input.action-checkbox').prop('checked', this.checked); $('input.action-checkbox').prop('checked', this.checked);
}); });
}); });
$(function() {
var inputs = $('input.action-checkbox');
inputs.change(function() {
var allInputsChecked = true;
for (var i = 0; i < inputs.length; i++) {
if (!inputs[i].checked) {
allInputsChecked = false;
break;
}
}
$('.action-rowtoggle').attr('checked', allInputsChecked);
});
});
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment