CRM-15705 - Use element title as default in crmConfirm
authorColeman Watts <coleman@civicrm.org>
Sat, 14 Feb 2015 15:05:12 +0000 (10:05 -0500)
committerColeman Watts <coleman@civicrm.org>
Sun, 15 Feb 2015 00:08:54 +0000 (19:08 -0500)
js/angular-crm-ui.js
partials/crmAttachment/attachments.html

index edcfbc472821d44d53f0cf6430c1b60aa6e48e14..50259ae9b7e52476064a91d36ccf5658c5d15a84 100644 (file)
         }
       };
       return {
-        template: '',
         link: function (scope, element, attrs) {
           $(element).click(function () {
             var options = scope.$eval(attrs.crmConfirm);
+            if (attrs.title && !options.title) {
+              options.title = attrs.title;
+            }
             var defaults = (options.type) ? defaultFuncs[options.type](options) : {};
             CRM.confirm(_.extend(defaults, options))
               .on('crmConfirm:yes', function () { scope.$apply(attrs.onYes); })
index 77161407801421d220e73ee07b13b2b9dfc0a0a7..9f9ad37602eacdf4b9ce82a71020ebc8a903ed0b 100644 (file)
@@ -12,7 +12,8 @@
       <td>
         <a
           crm-icon="trash"
-          crm-confirm="{message: ts('Deleting an attachment will completely remove it from server.'), title: ts('Delete Attachment?')}" on-yes="att.deleteFile(file)"
+          crm-confirm="{message: ts('Deleting an attachment will completely remove it from server.')}" on-yes="att.deleteFile(file)"
+          title="{{ts('Delete attachment')}}"
           class="crm-hover-button">
         </a>
       </td>