From: Dave Greenberg Date: Fri, 17 Jan 2014 02:45:02 +0000 (-0800) Subject: CRM-14081 - Alternate approach preserves useful focus behavior by default and elimina... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bdb9e2525878090ab76c4a3c80f1c06ed1cd2d62;p=civicrm-core.git 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 --- 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}