jsortable.tpl code cleanup
authorColeman Watts <coleman@civicrm.org>
Sat, 9 Aug 2014 15:30:53 +0000 (16:30 +0100)
committerColeman Watts <coleman@civicrm.org>
Sat, 9 Aug 2014 15:30:53 +0000 (16:30 +0100)
templates/CRM/common/jsortable.tpl

index bfcb5b3995324f8679a778a7a3795bf99667ab53..554f3d14005c586af087811fd5b65942c8af0d75 100644 (file)
@@ -66,8 +66,7 @@
     });
 
     //remove last comma
-    tableId = tableId.substring(0, tableId.length - 1 );
-    eval('tableId =[' + tableId + ']');
+    tableId = [tableId.substring(0, tableId.length - 1 )];
 
     $.each(tableId, function(i,n){
       tabId = '#option' + tcount + n;
         }
         count++;
       });
-      columns    = columns.substring(0, columns.length - 1 );
-      sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
-      eval('sortColumn =[' + sortColumn + ']');
-      eval('columns =[' + columns + ']');
+      columns = [columns.substring(0, columns.length - 1 )];
+      sortColumn = [sortColumn.substring(0, sortColumn.length - 1 )];
 
       var currTable = $(tabId);
       if (currTable) {
           "sDom"       : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
           "bServerSide": true,
           "sAjaxSource": sourceUrl,
-          "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
-            "sZeroRecords" : noRecordFoundMsg },
-
-          {/literal}{if !empty($callBack)}{literal}
-          "fnDrawCallback": function() { checkSelected(); },
-          {/literal}{/if}{literal}
+          "oLanguage":{
+            "sEmptyTable"  : noRecordFoundMsg,
+            "sZeroRecords" : noRecordFoundMsg
+          },
 
           "fnServerData": function ( sSource, aoData, fnCallback ) {
             $.ajax( {
           "bAutoWidth"   : false,
           "aoColumns"   : columns,
           "bSort" : true,
-          "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
-            "sZeroRecords" : noRecordFoundMsg }
+          "oLanguage":{
+            "sEmptyTable"  : noRecordFoundMsg,
+            "sZeroRecords" : noRecordFoundMsg
+          }
         });
       }
-      var object;
-
     });
   });