crmUiRichtext - Add support for ngBlur.
authorTim Otten <totten@civicrm.org>
Thu, 12 Feb 2015 00:30:06 +0000 (16:30 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 12 Feb 2015 19:59:17 +0000 (11:59 -0800)
js/angular-crm-ui.js

index d9f590678aefecb2c1b60a95790bce78b6f54d7e..0330bb565f10fe082c5b25e5ef6479dca0a3b55a 100644 (file)
 
     // Define a rich text editor.
     // example: <textarea crm-ui-id="myForm.body_html" crm-ui-richtext name="body_html" ng-model="mailing.body_html"></textarea>
-    // WISHLIST: use ngModel
     .directive('crmUiRichtext', function ($timeout) {
       return {
         require: '?ngModel',
             return;
           }
 
+          if (attr.ngBlur) {
+            ck.on('blur', function(){
+              $timeout(function(){
+                scope.$eval(attr.ngBlur);
+              })
+            });
+          }
+
           ck.on('pasteState', function () {
             scope.$apply(function () {
               ngModel.$setViewValue(ck.getData());