From 3e1507939bf96e4070b07ee63d4a5c51acf41721 Mon Sep 17 00:00:00 2001 From: kurund Date: Sun, 2 Mar 2014 23:49:42 +0530 Subject: [PATCH] code cleanup, CRM-14201 ---------------------------------------- * CRM-14201: Contact Relationships tab needs pagination http://issues.civicrm.org/jira/browse/CRM-14201 --- templates/CRM/common/enableDisableApi.tpl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/templates/CRM/common/enableDisableApi.tpl b/templates/CRM/common/enableDisableApi.tpl index 86d4f86eb5..d1b3cb1cb9 100644 --- a/templates/CRM/common/enableDisableApi.tpl +++ b/templates/CRM/common/enableDisableApi.tpl @@ -32,16 +32,8 @@ function refresh() { // Call native refresh method on ajax datatables if ($.fn.DataTable.fnIsDataTable($table[0]) && $table.dataTable().fnSettings().sAjaxSource) { - $table.unblock().dataTable().fnDraw(); - - // incase of more than 1 datatables on same page, refresh remaining datatables - $('table.dataTable').each(function () { - var currentTable = $(this); - if (currentTable.prop('id') != $table.prop('id')) { - if ($.fn.DataTable.fnIsDataTable(currentTable[0]) && currentTable.dataTable().fnSettings().sAjaxSource) { - currentTable.dataTable().fnDraw(); - } - } + $.each($.fn.dataTable.fnTables(), function() { + $(this).dataTable().fnSettings().sAjaxSource && $(this).unblock().dataTable().fnDraw(); }); } // Otherwise refresh the content area using crmSnippet -- 2.25.1