diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 261a21c29f..53e3cd4dbf 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -95,13 +95,10 @@ jQuery(document).ready(function ($) { }); }); -function checkAll (id, checked) { - var els = Element.descendants(id); - for (var i = 0; i < els.length; i++) { - if (els[i].disabled === false) { - els[i].checked = checked; - } - } +function checkAll(selector, checked) { + jQuery('#' + selector + ' input:checkbox').each(function() { + this.checked = checked; + }); } function toggleCheckboxesBySelector(selector) {