From bdb9e2525878090ab76c4a3c80f1c06ed1cd2d62 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Thu, 16 Jan 2014 18:45:02 -0800 Subject: [PATCH] CRM-14081 - Alternate approach preserves useful focus behavior by default and eliminates for soft credit block via new focus param for NewContact.tpl. ---------------------------------------- * CRM-14081: Create Contribution screen initially scrolls to and puts cursor in "Soft Credit" field http://issues.civicrm.org/jira/browse/CRM-14081 --- templates/CRM/Contact/Form/NewContact.tpl | 6 ++++-- templates/CRM/Contribute/Form/SoftCredit.tpl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/CRM/Contact/Form/NewContact.tpl b/templates/CRM/Contact/Form/NewContact.tpl index 41d5f35b33..d8f541ce31 100644 --- a/templates/CRM/Contact/Form/NewContact.tpl +++ b/templates/CRM/Contact/Form/NewContact.tpl @@ -27,7 +27,9 @@ {if !in_array($context, array('search','advanced', 'builder')) || $parent eq 'activity'} {assign var='fldName' value=$prefix|cat:'contact'} {assign var='profSelect' value=$prefix|cat:'profiles'} - + {* Focus on select contact element unless focus=false is passed in. *} + {assign var='focus' value=$focus|default:true} + {if $noLabel}
{if !$skipBreak} @@ -140,7 +142,7 @@ eval("{$newContactCallback}"); {/if} {literal} - }).focus( ); + }){/literal}{if $focus}.focus( ){/if}{literal}; cj( contactElement ).click( function( ) { cj( contactHiddenElement ).val(''); diff --git a/templates/CRM/Contribute/Form/SoftCredit.tpl b/templates/CRM/Contribute/Form/SoftCredit.tpl index 878f22203d..ec31a6d66d 100644 --- a/templates/CRM/Contribute/Form/SoftCredit.tpl +++ b/templates/CRM/Contribute/Form/SoftCredit.tpl @@ -37,7 +37,7 @@ {assign var='createNewStatus' value=false} {/if} {include file="CRM/Contact/Form/NewContact.tpl" noLabel=true skipBreak=true blockNo=$rowNumber - prefix="soft_credit_" showNewSelect=$createNewStatus} + prefix="soft_credit_" showNewSelect=$createNewStatus focus=false} {$form.soft_credit_amount.$rowNumber.label} {$form.soft_credit_amount.$rowNumber.html|crmAddClass:eight} -- 2.25.1