From: Coleman Watts Date: Wed, 20 Aug 2014 14:54:21 +0000 (+0100) Subject: CRM-13863 - Add ajax paging to contribution tab and dashboard X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d0e79cbd902d84e0a47ec05020b0770c6babf62e;p=civicrm-core.git CRM-13863 - Add ajax paging to contribution tab and dashboard --- diff --git a/templates/CRM/Contribute/Form/Selector.tpl b/templates/CRM/Contribute/Form/Selector.tpl index 5536591305..d9532edd09 100644 --- a/templates/CRM/Contribute/Form/Selector.tpl +++ b/templates/CRM/Contribute/Form/Selector.tpl @@ -23,9 +23,7 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if $context EQ 'Search'} - {include file="CRM/common/pager.tpl" location="top"} -{/if} +{include file="CRM/common/pager.tpl" location="top"} {strip} @@ -93,23 +91,7 @@ {/foreach} -{* Link to "View all contributions" for Contact Summary selector display *} -{if $limit and $pager->_totalItems GT $limit } - {if $context eq 'dashboard' } - - - - {elseif $context eq 'contribution' } - - - - {/if} -{/if}
» {ts}Find more contributions{/ts}...
» {ts}View all contributions from this contact{/ts}...
{/strip} - - -{if $context EQ 'Search'} - {include file="CRM/common/pager.tpl" location="bottom"} -{/if} +{include file="CRM/common/pager.tpl" location="bottom"} diff --git a/templates/CRM/Contribute/Page/DashBoard.js b/templates/CRM/Contribute/Page/DashBoard.js index b56013ecdf..653a6ceb09 100644 --- a/templates/CRM/Contribute/Page/DashBoard.js +++ b/templates/CRM/Contribute/Page/DashBoard.js @@ -1,7 +1,7 @@ // http://civicrm.org/licensing /*jslint indent: 2 */ /*global CRM, cj */ -CRM.$(function($) { +(function($) { 'use strict'; var load = { @@ -21,20 +21,24 @@ CRM.$(function($) { } }; - $('#chart_view, #table_view').click(function() { - if ($(this).hasClass('ui-state-default')) { - $('.ui-tabs-selected', '#mainTabContainer').removeClass('ui-state-active ui-tabs-selected').addClass('ui-state-default'); - $(this).removeClass('ui-state-default').addClass('ui-state-active ui-tabs-selected'); - load[this.id](); + $('#crm-container').on('crmLoad', function (e) { + if ($(e.target).is('#crm-main-content-wrapper, #crm-container')) { + $('#chart_view, #table_view').click(function () { + if ($(this).hasClass('ui-state-default')) { + $('.ui-tabs-selected', '#mainTabContainer').removeClass('ui-state-active ui-tabs-selected').addClass('ui-state-default'); + $(this).removeClass('ui-state-default').addClass('ui-state-active ui-tabs-selected'); + load[this.id](); + } + }); + + // Initialize chart or table based on url hash + if (window.location.hash === '#table_layout') { + $('#table_view').click(); + } + else { + load.chart_view(); + } } }); - - // Initialize chart or table based on url hash - if (window.location.hash === '#table_layout') { - $('#table_view').click(); - } - else { - load.chart_view(); - } -}); +})(CRM.$); diff --git a/templates/CRM/Contribute/Page/DashBoard.tpl b/templates/CRM/Contribute/Page/DashBoard.tpl index ec124d5ea6..0c856353e8 100644 --- a/templates/CRM/Contribute/Page/DashBoard.tpl +++ b/templates/CRM/Contribute/Page/DashBoard.tpl @@ -66,15 +66,14 @@
- + - - +
- {ts}Manage Contribution Pages{/ts} - + {ts}Manage Contribution Pages{/ts}
{ts}Add Contribution Page{/ts} -
+
+
{ts}Add Contribution Page{/ts}
{/if}