additional js cleanup done by coleman
authorJitendra Purohit <jitendra@fuzion.co.nz>
Thu, 7 Dec 2017 06:02:23 +0000 (11:32 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Thu, 7 Dec 2017 06:02:23 +0000 (11:32 +0530)
templates/CRM/Admin/Form/Preferences/Display.tpl

index 7efd5cfcf1be389119155e71a47faf31289df512..04c7263d4e0a1eec6115e08650406cdf5954d9b5 100644 (file)
           $('#contact_edit_preferences').val(params.toString());
         }
 
-        //show/hide activity types based on checkbox value
-        if ($('#activity_assignee_notification').is(":checked")) {
-          $('.crm-preferences-display-form-activity_types').show();
-        }
-        else {
-          $('.crm-preferences-display-form-activity_types').hide();
-        }
+        // show/hide activity types based on checkbox value
+        $('.crm-preferences-display-form-activity_types').toggle($('#activity_assignee_notification').is(":checked"));
         $('#activity_assignee_notification').click(function() {
-          $('.crm-preferences-display-form-activity_types').toggle($('#activity_assignee_notification').is(":checked"));
+          $('.crm-preferences-display-form-activity_types').toggle($(this).is(":checked"));
         });
 
         var invoicesKey = '{/literal}{$invoicesKey}{literal}';