From: Coleman Watts Date: Sat, 9 Aug 2014 15:30:53 +0000 (+0100) Subject: jsortable.tpl code cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=634598a14294f61415b2269d7268285ca6b5bd1d;p=civicrm-core.git jsortable.tpl code cleanup --- diff --git a/templates/CRM/common/jsortable.tpl b/templates/CRM/common/jsortable.tpl index bfcb5b3995..554f3d1400 100644 --- a/templates/CRM/common/jsortable.tpl +++ b/templates/CRM/common/jsortable.tpl @@ -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; @@ -112,10 +111,8 @@ } 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) { @@ -148,12 +145,10 @@ "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( { @@ -176,12 +171,12 @@ "bAutoWidth" : false, "aoColumns" : columns, "bSort" : true, - "oLanguage":{"sEmptyTable" : noRecordFoundMsg, - "sZeroRecords" : noRecordFoundMsg } + "oLanguage":{ + "sEmptyTable" : noRecordFoundMsg, + "sZeroRecords" : noRecordFoundMsg + } }); } - var object; - }); });