Fix address add CRM-12224
authorColeman Watts <coleman@civicrm.org>
Wed, 27 Mar 2013 00:09:58 +0000 (17:09 -0700)
committerColeman Watts <coleman@civicrm.org>
Wed, 27 Mar 2013 00:22:59 +0000 (17:22 -0700)
templates/CRM/Contact/Page/View/Summary.js

index 35b365fbf80656b132cab1ed87859ade577f3c3c..059e5345824df2bc44b6a3b4b948acf02f1ee79f 100644 (file)
@@ -52,9 +52,9 @@
       // Clone the add-new link if replacing it, and queue the clone to be refreshed as a dependent block
       if (o.hasClass('add-new') && response.addressId) {
         data.aid = response.addressId;
-        var clone = o.parent().clone();
+        var clone = o.closest('.crm-summary-block').clone();
         o.data('edit-params', data);
-        $('.crm-container-snippet', clone).remove();
+        $('form', clone).remove();
         if (clone.hasClass('contactCardLeft')) {
           clone.removeClass('contactCardLeft').addClass('contactCardRight');
         }
@@ -65,7 +65,7 @@
         var clData = cl.data('edit-params');
         var locNo = clData.locno++;
         cl.attr('id', cl.attr('id').replace(locNo, clData.locno)).removeClass('form');
-        o.parent().after(clone);
+        o.closest('.crm-summary-block').after(clone);
         $.merge(dependent, $('.crm-inline-edit', clone));
       }
       $('a.ui-notify-close', '#crm-notification-container').click();