CRM-16596 - Fix adding PDF activity to case
[civicrm-core.git] / templates / CRM / Contact / Form / Task / PDFLetterCommon.tpl
index 89f6c21eed50ac806d2dbd5aea7be3f6f8bf325a..44a9545e01008125c78a677cbddd28153e7dc9d9 100644 (file)
@@ -128,6 +128,11 @@ CRM.$(function($) {
   $('#format_id', $form).on('change', function() {
     selectFormat($(this).val());
   });
+  // After the pdf downloads, the user has to manually close the dialog (which would be nice to fix)
+  // But at least we can trigger the underlying list of activities to refresh
+  $form.closest('.ui-dialog-content.crm-ajax-container').on('dialogbeforeclose', function() {
+    $(this).trigger('crmFormSuccess');
+  });
 });
 
 var currentWidth;