CRM-11610 - Search js - Abstract table row highlight/select
[civicrm-core.git] / templates / CRM / Contact / Form / Selector.tpl
index 7df3c0263df83cdc862d04ba7edb212d2fd77c48..ba2a5acee939099ef683b49e45f250f28ea8b37a 100644 (file)
@@ -1,6 +1,6 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
               </td>
            {else}
               {foreach from=$row item=value key=key}
-                {if ($key neq "checkbox") and ($key neq "action") and ($key neq "contact_type") and ($key neq "contact_sub_type") and ($key neq "status") and ($key neq "sort_name") and ($key neq "contact_id")}
+                {if ($key neq "checkbox") and ($key neq "action") and ($key neq "contact_type") and ($key neq "contact_sub_type") and ($key neq "status") and ($key neq "sort_name") and ($key neq "contact_id") and ($key neq "contact_type_orig")}
                  <td>{$value}&nbsp;</td>
                 {/if}
               {/foreach}
 <script type="text/javascript">
   {literal}
   cj(function($) {
-    cj("#toggleSelect, input[id^=mark_x_]").removeAttr('checked');
+    cj("#toggleSelect, input[id^=mark_x_]").prop('checked', false);
     var cids = [];
     var i = 0;
     {/literal}
       cids[i++] = "#mark_x_{$selectedContactId}";
     {/foreach}
     {literal}
-    $(cids.join(',')).attr('checked', 'checked');
+    $(cids.join(',')).prop('checked', true);
     if (cids.length > 0) {
-      $('input[name=radio_ts][value=ts_sel]').attr('checked', 'checked');
+      $('input[name=radio_ts][value=ts_sel]').prop('checked', true);
     }
     var params = {getCount: cids.length};
     countSelections(params);
-    on_load_init_checkboxes("{/literal}{$form.formName}{literal}");
   });
 function countSelections(obj) {
   var label = cj('label[for*=ts_sel]');
@@ -177,7 +176,6 @@ function countSelections(obj) {
     }
     toggleTaskAction(obj.getCount);
   }
-  on_load_init_checkboxes("{/literal}{$form.formName}{literal}");
 }
 function toggleContactSelection(name, qfKey, selection) {
   var url = CRM.url('civicrm/ajax/markSelection');
@@ -196,12 +194,13 @@ function toggleContactSelection(name, qfKey, selection) {
   }
   else if (name == 'resetSel' && selection == 'reset') {
     params.variableType = 'multiple';
-    cj("#toggleSelect, input[id^=mark_x_]").removeAttr('checked');
+    cj("#toggleSelect, input[id^=mark_x_]").prop('checked', false);
   }
   else {
     params.name = name;
   }
   cj.getJSON(url, params, countSelections);
+  return false;
 }
 {/literal}
 </script>