From 113266571c5b4713e2f963c773cfa4e0a7050934 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 20 Aug 2014 22:28:01 +0100 Subject: [PATCH] Cleanup inline-edit add/remove buttons --- css/civicrm.css | 5 ----- templates/CRM/Contact/Form/Inline/Email.tpl | 4 ++-- templates/CRM/Contact/Form/Inline/IM.tpl | 4 ++-- templates/CRM/Contact/Form/Inline/OpenID.tpl | 4 ++-- templates/CRM/Contact/Form/Inline/Phone.tpl | 4 ++-- templates/CRM/Contact/Form/Inline/Website.tpl | 4 ++-- templates/CRM/Contact/Page/View/Summary.js | 8 +++++--- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/css/civicrm.css b/css/civicrm.css index 1d13104a9e..dae7ae265c 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -2107,11 +2107,6 @@ div.grippie { padding-top: 5px; } -#crm-container a.crm-link-action { - cursor: pointer; - cursor: hand; -} - #crm-container span.crm-custom-greeting { font-size: 9px; } diff --git a/templates/CRM/Contact/Form/Inline/Email.tpl b/templates/CRM/Contact/Form/Inline/Email.tpl index 73fea94c00..2cae309ad9 100644 --- a/templates/CRM/Contact/Form/Inline/Email.tpl +++ b/templates/CRM/Contact/Form/Inline/Email.tpl @@ -36,7 +36,7 @@ {ts}Email{/ts}  {if $actualBlockCount lt 5 } - {ts}add{/ts} + {ts}add{/ts} {/if} {ts}On Hold?{/ts} @@ -58,7 +58,7 @@ {$form.email.$blockId.is_primary.1.html} {if $blockId gt 1} - {ts}delete{/ts} + {/if} diff --git a/templates/CRM/Contact/Form/Inline/IM.tpl b/templates/CRM/Contact/Form/Inline/IM.tpl index 152d2e89c9..433e40fbd8 100644 --- a/templates/CRM/Contact/Form/Inline/IM.tpl +++ b/templates/CRM/Contact/Form/Inline/IM.tpl @@ -36,7 +36,7 @@ {ts}Instant Messenger{/ts}  {if $actualBlockCount lt 5 } - {ts}add{/ts} + {ts}add{/ts} {/if} {ts}IM Location{/ts} @@ -53,7 +53,7 @@ {$form.im.$blockId.is_primary.1.html} {if $blockId gt 1} - {ts}delete{/ts} + {/if} diff --git a/templates/CRM/Contact/Form/Inline/OpenID.tpl b/templates/CRM/Contact/Form/Inline/OpenID.tpl index c915f9ceda..572764da67 100644 --- a/templates/CRM/Contact/Form/Inline/OpenID.tpl +++ b/templates/CRM/Contact/Form/Inline/OpenID.tpl @@ -37,7 +37,7 @@ {ts}Open ID{/ts}  {if $actualBlockCount lt 5 } - {ts}add{/ts} + {ts}add{/ts} {/if} {ts}Open ID Location{/ts} @@ -53,7 +53,7 @@ {$form.openid.$blockId.is_primary.1.html} {if $blockId gt 1} - {ts}delete{/ts} + {/if} diff --git a/templates/CRM/Contact/Form/Inline/Phone.tpl b/templates/CRM/Contact/Form/Inline/Phone.tpl index 327b02dce0..5212461df6 100644 --- a/templates/CRM/Contact/Form/Inline/Phone.tpl +++ b/templates/CRM/Contact/Form/Inline/Phone.tpl @@ -36,7 +36,7 @@ {ts}Phone{/ts}  {if $actualBlockCount lt 5 } - {ts}add{/ts} + {ts}add{/ts} {/if} {ts}Phone Location{/ts} @@ -53,7 +53,7 @@ {$form.phone.$blockId.is_primary.1.html} {if $blockId gt 1} - {ts}delete{/ts} + {/if} diff --git a/templates/CRM/Contact/Form/Inline/Website.tpl b/templates/CRM/Contact/Form/Inline/Website.tpl index 327473a0c9..2805e24e48 100644 --- a/templates/CRM/Contact/Form/Inline/Website.tpl +++ b/templates/CRM/Contact/Form/Inline/Website.tpl @@ -38,7 +38,7 @@ {ts}Website{/ts} {help id="id-website" file="CRM/Contact/Form/Contact.hlp"} {if $actualBlockCount lt 5 } -   {ts}add{/ts} +   {ts}add{/ts} {/if} {ts}Website Type{/ts} @@ -52,7 +52,7 @@ {$form.website.$blockId.website_type_id.html} {if $blockId > 1} - {ts}delete{/ts} + {/if} diff --git a/templates/CRM/Contact/Page/View/Summary.js b/templates/CRM/Contact/Page/View/Summary.js index 4ee0866581..44dce9f3e7 100644 --- a/templates/CRM/Contact/Page/View/Summary.js +++ b/templates/CRM/Contact/Page/View/Summary.js @@ -239,10 +239,10 @@ } }) // handle delete link within blocks - .on('click', '.crm-delete-inline', function() { + .on('click', '.crm-delete-inline', function(e) { var row = $(this).closest('tr'); var form = $(this).closest('form'); - row.addClass('hiddenElement'); + row.hide(); $('input', row).val(''); //if the primary is checked for deleted block //unset and set first as primary @@ -251,6 +251,7 @@ $('[class$=is_primary] input:first', form).prop('checked', true ); } $('.add-more-inline', form).show(); + e.preventDefault(); }) // Delete an address .on('click', '.crm-inline-edit.address .delete-button', function() { @@ -271,7 +272,7 @@ return false; }) // add more and set focus to new row - .on('click', '.add-more-inline', function() { + .on('click', '.add-more-inline', function(e) { var form = $(this).closest('form'); var row = $('tr[class="hiddenElement"]:first', form); row.removeClass('hiddenElement'); @@ -280,6 +281,7 @@ if ($('tr[class="hiddenElement"]').length < 1) { $(this).hide(); } + e.preventDefault(); }); // Trigger cancel button on esc keypress $(document).keydown(function(key) { -- 2.25.1