Cleanup inline-edit add/remove buttons
authorColeman Watts <coleman@civicrm.org>
Wed, 20 Aug 2014 21:28:01 +0000 (22:28 +0100)
committerColeman Watts <coleman@civicrm.org>
Wed, 20 Aug 2014 21:28:01 +0000 (22:28 +0100)
css/civicrm.css
templates/CRM/Contact/Form/Inline/Email.tpl
templates/CRM/Contact/Form/Inline/IM.tpl
templates/CRM/Contact/Form/Inline/OpenID.tpl
templates/CRM/Contact/Form/Inline/Phone.tpl
templates/CRM/Contact/Form/Inline/Website.tpl
templates/CRM/Contact/Page/View/Summary.js

index 1d13104a9eb84c900344392b09338c98fb1727ab..dae7ae265cd94a0f3933d42d3d087ff628e4f331 100644 (file)
@@ -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;
 }
index 73fea94c0041ce15c771da6ad2e5c4e0c9bb52e7..2cae309ad96639cf9b880f9a35bbb08c5fcae062 100644 (file)
@@ -36,7 +36,7 @@
     <tr>
       <td>{ts}Email{/ts}&nbsp;
       {if $actualBlockCount lt 5 }
-        <span id="add-more-email" title="{ts}click to add more{/ts}"><a class="crm-link-action add-more-inline">{ts}add{/ts}</a></span>
+        <span id="add-more-email" title="{ts}click to add more{/ts}"><a class="crm-hover-button action-item add-more-inline" href="#">{ts}add{/ts}</a></span>
       {/if}
       </td>
       <td>{ts}On Hold?{/ts}</td>
@@ -58,7 +58,7 @@
             <td align="center" class="crm-email-is_primary">{$form.email.$blockId.is_primary.1.html}</td>
             <td>
               {if $blockId gt 1}
-                <a title="{ts}delete email block{/ts}" class="crm-delete-inline crm-link-action">{ts}delete{/ts}</a>
+                <a title="{ts}Delete Email{/ts}" class="crm-delete-inline crm-hover-button" href="#"><span class="icon delete-icon"></span></a>
               {/if}
             </td>
         </tr>
index 152d2e89c93d7773e87f04489ec1a074a5f085f5..433e40fbd85637ff87e2c06cc56610402d8c5c59 100644 (file)
@@ -36,7 +36,7 @@
     <tr>
       <td>{ts}Instant Messenger{/ts}&nbsp;
       {if $actualBlockCount lt 5 }
-        <span id="add-more-im" title="{ts}click to add more{/ts}"><a class="crm-link-action add-more-inline">{ts}add{/ts}</a></span>
+        <span id="add-more-im" title="{ts}click to add more{/ts}"><a class="crm-hover-button action-item add-more-inline" href="#">{ts}add{/ts}</a></span>
       {/if}
       </td>
       <td>{ts}IM Location{/ts}</td>
@@ -53,7 +53,7 @@
         <td align="center" class="crm-im-is_primary">{$form.im.$blockId.is_primary.1.html}</td>
         <td>
           {if $blockId gt 1}
-            <a class="crm-delete-inline crm-link-action" title="{ts}delete im block{/ts}">{ts}delete{/ts}</a>
+            <a class="crm-delete-inline crm-hover-button" href="#" title="{ts}Delete IM{/ts}"><span class="icon delete-icon"></span></a>
           {/if}
         </td>
     </tr>
index c915f9cedaf5ecc43b37f71db036cd8f6b479b90..572764da67986f4dbeff142551b5d3ffaf3a1042 100644 (file)
@@ -37,7 +37,7 @@
   <tr>
     <td>{ts}Open ID{/ts}&nbsp;
     {if $actualBlockCount lt 5 }
-      <span id="add-more-openid" title="{ts}click to add more{/ts}"><a class="crm-link-action add-more-inline">{ts}add{/ts}</a></span>
+      <span id="add-more-openid" title="{ts}click to add more{/ts}"><a class="crm-hover-button action-item add-more-inline" href="#">{ts}add{/ts}</a></span>
     {/if}
     </td>
     <td>{ts}Open ID Location{/ts}</td>
@@ -53,7 +53,7 @@
     <td align="center" id="OpenID-Primary-html" class="crm-openid-is_primary">{$form.openid.$blockId.is_primary.1.html}</td>
     <td>
       {if $blockId gt 1}
-        <a class="crm-delete-inline crm-link-action" title="{ts}Delete OpenID Block{/ts}">{ts}delete{/ts}</a>
+        <a class="crm-delete-inline crm-hover-button" href="#" title="{ts}Delete OpenID{/ts}"><span class="icon delete-icon"></span></a>
       {/if}
     </td>
   </tr>
index 327b02dce00a59d0f2d312886a9218d364a16039..5212461df6a688e15813d6097e213b6564e811b3 100644 (file)
@@ -36,7 +36,7 @@
     <tr>
       <td>{ts}Phone{/ts}&nbsp;
       {if $actualBlockCount lt 5 }
-        <span id="add-more-phone" title="{ts}click to add more{/ts}"><a class="crm-link-action add-more-inline">{ts}add{/ts}</a></span>
+        <span id="add-more-phone" title="{ts}click to add more{/ts}"><a class="crm-hover-button action-item add-more-inline" href="#">{ts}add{/ts}</a></span>
       {/if}
       </td>
       <td>{ts}Phone Location{/ts}</td>
@@ -53,7 +53,7 @@
         <td align="center" class="crm-phone-is_primary">{$form.phone.$blockId.is_primary.1.html}</td>
         <td>
           {if $blockId gt 1}
-            <a class="crm-delete-inline crm-link-action" title="{ts}delete phone block{/ts}">{ts}delete{/ts}</a>
+            <a class="crm-delete-inline crm-hover-button\" href="#" title="{ts}Delete phone{/ts}"><span class="icon delete-icon"></span></a>
           {/if}
         </td>
     </tr>
index 327473a0c98a15acde7c8d3cb5e652c02fbf2992..2805e24e4873b9e043781b4e5d98c0eba1b83983 100644 (file)
@@ -38,7 +38,7 @@
       <td>{ts}Website{/ts}
         {help id="id-website" file="CRM/Contact/Form/Contact.hlp"}
         {if $actualBlockCount lt 5 }
-          &nbsp;&nbsp;<span id="add-more-website" title="{ts}click to add more{/ts}"><a class="crm-link-action add-more-inline">{ts}add{/ts}</a></span>
+          &nbsp;&nbsp;<span id="add-more-website" title="{ts}click to add more{/ts}"><a class="crm-hover-button action-item add-more-inline" href="#">{ts}add{/ts}</a></span>
         {/if}
       </td>
       <td>{ts}Website Type{/ts}</td>
@@ -52,7 +52,7 @@
       <td>{$form.website.$blockId.website_type_id.html}</td>
       <td>
         {if $blockId > 1} 
-          <a class="crm-delete-inline crm-link-action" title="{ts}delete website block{/ts}">{ts}delete{/ts}</a>
+          <a class="crm-delete-inline crm-hover-button action-item" href="#" title="{ts}Delete Website{/ts}"><span class="icon delete-icon"></span></a>
         {/if}
        </td>
     </tr>
index 4ee08665810babe10a2bf9f93a61476d41cbbf6d..44dce9f3e71692c7ad55ab6a7567c0339b6f5e71 100644 (file)
         }
       })
       // 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
           $('[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() {
         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');
         if ($('tr[class="hiddenElement"]').length < 1) {
           $(this).hide();
         }
+        e.preventDefault();
       });
     // Trigger cancel button on esc keypress
     $(document).keydown(function(key) {