X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=templates%2FCRM%2Fcommon%2Fpager.tpl;h=f99479cf7615ede838dcbe5fa4609b0c97e8245b;hb=13da61c7967d5e30a0e335060fc43465d4fe5625;hp=83edc911f51abe1fa9cf482b28826b6d95c953b2;hpb=03298d98322f2da05e2ab30cb0e2d5b90df47ab3;p=civicrm-core.git diff --git a/templates/CRM/common/pager.tpl b/templates/CRM/common/pager.tpl index 83edc911f5..f99479cf76 100644 --- a/templates/CRM/common/pager.tpl +++ b/templates/CRM/common/pager.tpl @@ -1,6 +1,6 @@ {* +--------------------------------------------------------------------+ - | CiviCRM version 4.5 | + | CiviCRM version 4.6 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ @@ -48,8 +48,8 @@ {* Controller for 'Rows Per Page' *} {if $location eq 'bottom' and $pager->_totalItems > 25}
-   - +   +
{/if} @@ -60,7 +60,7 @@ CRM.$(function($) { {/literal} var - $form = $('#{$form.formName}'), + $form = $({if empty($form.formClass)}'#crm-main-content-wrapper'{else}'form.{$form.formClass}'{/if}), numPages = {$pager->_response.numPages}, currentPage = {$pager->_response.currentPage}, perPageCount = {$pager->_perPage}, @@ -72,7 +72,7 @@ if (!refreshing) { refreshing = true; var options = url ? {url: url} : {}; - $form.off().closest('.crm-ajax-container, #crm-main-content-wrapper').crmSnippet(options).crmSnippet('refresh'); + $form.off('.crm-pager').closest('.crm-ajax-container, #crm-main-content-wrapper').crmSnippet(options).crmSnippet('refresh'); } } function page(num) { @@ -115,7 +115,7 @@ }) .on('keyup keydown keypress', preventSubmit); $form - .on('click', 'a.ui-spinner-button', function(e) { + .on('click.crm-pager', 'a.ui-spinner-button', function(e) { var $el = $(this); // Update after a short delay to allow multiple clicks spinning !== null && window.clearTimeout(spinning); @@ -127,9 +127,10 @@ } }, 200); }) - .on('click', 'a.crm-pager-link, #alpha-filter a', function() { + // Handle sorting, paging and alpha filtering links + .on('click.crm-pager', 'a.crm-pager-link, #alpha-filter a, th a.sorting, th a.sorting_desc, th a.sorting_asc', function(e) { refresh($(this).attr('href')); - return false; + e.preventDefault(); }); }); {/literal}