Prevent double confirm box when deleting attachments
authorColeman Watts <coleman@civicrm.org>
Thu, 28 Aug 2014 20:59:24 +0000 (21:59 +0100)
committerColeman Watts <coleman@civicrm.org>
Thu, 28 Aug 2014 20:59:24 +0000 (21:59 +0100)
templates/CRM/Form/attachmentjs.tpl

index 098a15b270a03cc8e7c037ad864fbefecf1bb4e1..19823c2637440e1ad3758948caf607e432344293 100644 (file)
@@ -1,7 +1,7 @@
 <script type="text/javascript">
 {literal}
   CRM.$(function($) {
-    $('a.delete-attachment').click(function(e) {
+    $('a.delete-attachment').off('.crmAttachments').on('click.crmAttachments', function(e) {
       var $el = $(this),
         $row = $el.closest('.crm-attachment-wrapper'),
         msg = '{/literal}{ts escape="js" 1="%1"}This will immediately delete the file %1. This action cannot be undone.{/ts}{literal}';