From e8a13789038150776aa83e24d8046c4dc23fb160 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 11 Mar 2014 14:35:49 -0400 Subject: [PATCH] CRM-14336 - Clear up potential memory leaks from ajaxForm --- templates/CRM/Contact/Page/View/Summary.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Contact/Page/View/Summary.js b/templates/CRM/Contact/Page/View/Summary.js index 82a46c4ce6..e8c76d22d9 100644 --- a/templates/CRM/Contact/Page/View/Summary.js +++ b/templates/CRM/Contact/Page/View/Summary.js @@ -43,6 +43,7 @@ function requestHandler(response) { var o = $('div.crm-inline-edit.form'); + $('form', o).ajaxFormUnbind(); if (response.status == 'save' || response.status == 'cancel') { o.trigger('crmFormSuccess', [response]); @@ -99,7 +100,6 @@ } else { // Handle formRule error - $('form', o).ajaxForm('destroy'); $('.crm-container-snippet', o).replaceWith(response.content); $('form', o).validate(CRM.validate.params); $('form', o).ajaxForm(ajaxFormParams); @@ -211,6 +211,7 @@ // Inline edit form cancel button .on('click', '.crm-inline-edit :submit[name$=cancel]', function() { var container = $(this).closest('.crm-inline-edit.form'); + $('form', container).ajaxFormUnbind(); $('.inline-edit-hidden-content', container).nextAll().remove(); $('.inline-edit-hidden-content > *:first-child', container).unwrap(); container.removeClass('form'); -- 2.25.1