diff --git a/app/assets/javascripts/dashboard.js b/app/assets/javascripts/dashboard.js index 72d156c56d..cc19e01ed8 100644 --- a/app/assets/javascripts/dashboard.js +++ b/app/assets/javascripts/dashboard.js @@ -45,8 +45,15 @@ $('.node-type-' + type).prop('checked', checked); } + + $('.node-type').change(function () { + var check = ($('.node-type').filter(":checked").length == $('.node-type').length); + $('.node-type-all').prop("checked", check); + }); - + $('.node-type-all').click(function () { + $('.node-type').prop('checked', this.checked); + }); // if all checked? var checked_array = $(".node-type").map(function(i, el) { return $(el).prop('checked'); });