From 22738c2fcc17f955a1073f289435f6d4823cfd11 Mon Sep 17 00:00:00 2001 From: keshav sethi Date: Tue, 18 Feb 2020 00:31:27 +0530 Subject: [PATCH 1/3] select all --- app/assets/javascripts/dashboard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/dashboard.js b/app/assets/javascripts/dashboard.js index 72d156c56d..2c7cc6916b 100644 --- a/app/assets/javascripts/dashboard.js +++ b/app/assets/javascripts/dashboard.js @@ -45,7 +45,9 @@ $('.node-type-' + type).prop('checked', checked); } - + $('.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'); }); From e7cac2d80877a5f11e57b936736359c85e286882 Mon Sep 17 00:00:00 2001 From: keshav sethi Date: Tue, 18 Feb 2020 02:38:20 +0530 Subject: [PATCH 2/3] select all updated --- app/assets/javascripts/dashboard.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/dashboard.js b/app/assets/javascripts/dashboard.js index 2c7cc6916b..14cf7b94ac 100644 --- a/app/assets/javascripts/dashboard.js +++ b/app/assets/javascripts/dashboard.js @@ -48,6 +48,10 @@ $('.node-type-all').click(function () { $('.node-type').prop('checked', this.checked); }); + $('.node-type').change(function () { + var check = ($('.node-type').filter(":checked").length == $('.node-type').length); + $('.node-type-all').prop("checked", check); + }); // if all checked? var checked_array = $(".node-type").map(function(i, el) { return $(el).prop('checked'); }); From b7192884f391b95083a2139f528e21f2d50bb534 Mon Sep 17 00:00:00 2001 From: keshav sethi Date: Thu, 14 May 2020 03:56:38 +0530 Subject: [PATCH 3/3] select all --- app/assets/javascripts/dashboard.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/dashboard.js b/app/assets/javascripts/dashboard.js index 14cf7b94ac..cc19e01ed8 100644 --- a/app/assets/javascripts/dashboard.js +++ b/app/assets/javascripts/dashboard.js @@ -45,14 +45,15 @@ $('.node-type-' + type).prop('checked', checked); } - $('.node-type-all').click(function () { - $('.node-type').prop('checked', this.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'); });