CRM-11610 - Search js - Abstract table row highlight/select
[civicrm-core.git] / templates / CRM / Contact / Form / Selector.tpl
index 3fbb83db511b1d8cfb487b7db242e52ede7939bd..ba2a5acee939099ef683b49e45f250f28ea8b37a 100644 (file)
 <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>