From bec7aba824319262f5ef1fe2486f642adf20e5f6 Mon Sep 17 00:00:00 2001 From: jpl Date: Tue, 7 Feb 2017 18:13:09 +0100 Subject: Refs #2535: fix multiselect on tables --- app/assets/javascripts/selectable_table.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/assets/javascripts/selectable_table.coffee') diff --git a/app/assets/javascripts/selectable_table.coffee b/app/assets/javascripts/selectable_table.coffee index 7cddc3744..84a026d8a 100644 --- a/app/assets/javascripts/selectable_table.coffee +++ b/app/assets/javascripts/selectable_table.coffee @@ -5,7 +5,7 @@ if e.currentTarget.id == '0' selection = [] if e.currentTarget.checked - $("[type='checkbox']").each -> + $(this).closest('.table').find("[type='checkbox']").each -> $(this).prop('checked', true) # Add each element to selection selection.push($(this).attr('id')) @@ -14,7 +14,7 @@ selection.splice(0, 1) else - $("[type='checkbox']").each -> + $(this).closest('.table').find("[type='checkbox']").each -> $(this).prop('checked', false) # Empty selection selection = [] -- cgit v1.2.3