From 4afed912be5d973081b0dfefa6b14953b6288229 Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Fri, 23 Aug 2013 16:30:22 +0530 Subject: [PATCH] CRM-13265 made bi-directional toggle option available, keeping uni-directional as default for core. --- templates/CRM/Report/Form/Criteria.tpl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/templates/CRM/Report/Form/Criteria.tpl b/templates/CRM/Report/Form/Criteria.tpl index 7e34eae558..fd85ecd62d 100644 --- a/templates/CRM/Report/Form/Criteria.tpl +++ b/templates/CRM/Report/Form/Criteria.tpl @@ -71,7 +71,7 @@ {foreach from=$groupByElements item=gbElem key=dnc} {assign var="count" value=`$count+1`} - + {$form.group_bys[$gbElem].html} {if $form.group_bys_freq[$gbElem].html}:
  {$form.group_bys_freq[$gbElem].label} {$form.group_bys_freq[$gbElem].html} @@ -254,16 +254,16 @@ } } - function selectGroupByFields(id) { - var field = 'fields_'+ id; - var group = 'group_bys_'+ id; - var groups = document.getElementById( group ).checked; - if ( groups == 1 ) { - document.getElementById( field ).checked = true; - } else { - document.getElementById( field ).checked = false; - } - } + cj(document).ready(function(){ + cj('.crm-report-criteria-groupby input:checkbox').click(function() { + cj('#fields_' + this.id.substr(10)).prop('checked', this.checked); + }); + {/literal}{if $displayToggleGroupByFields}{literal} + cj('.crm-report-criteria-field input:checkbox').click(function() { + cj('#group_bys_' + this.id.substr(7)).prop('checked', this.checked); + }); + {/literal}{/if}{literal} + }); {/literal} -- 2.25.1