code cleanup
[civicrm-core.git] / js / angular-crm-ui.js
index 211a2aa861cae06cbb12ed5c9961ce44d8253b0e..793750e8d202dad848b4b47a744215e5927f72c5 100644 (file)
         }
       };
     })
-    // Example: <button crm-confirm="{message: ts('Frobincation is a footastical operation')}" on-yes="frobnicate(123)">Frobincate</button>
+    // Example: <button crm-confirm="{message: ts('Are you sure you want to continue?')}" on-yes="frobnicate(123)">Frobincate</button>
     // Example: <button crm-confirm="{type: 'disable', obj: myObject}" on-yes="myObject.is_active=0; myObject.save()">Disable</button>
     .directive('crmConfirm', function () {
       // Helpers to calculate default options for CRM.confirm()
             })
           };
         },
+        'revert': function (options) {
+          return {
+            message: ts('Are you sure you want to revert this?'),
+            options: {no: ts('Cancel'), yes: ts('Revert')},
+            width: 300,
+            title: ts('Revert %1?', {
+              1: options.obj.title || options.obj.label || options.obj.name || ts('the record')
+            })
+          };
+        },
         'delete': function (options) {
           return {
             message: ts('Are you sure you want to delete this?'),
     })
   ;
 
-})(angular, CRM.$, CRM._);
\ No newline at end of file
+})(angular, CRM.$, CRM._);