crmUiField - Remove double-$parent
authorTim Otten <totten@civicrm.org>
Mon, 16 Mar 2015 01:25:42 +0000 (18:25 -0700)
committerColeman Watts <coleman@civicrm.org>
Thu, 19 Mar 2015 15:39:48 +0000 (11:39 -0400)
js/angular-crm-ui.js
partials/crmUi/field-cb.html
partials/crmUi/field.html

index e68b3a10f71da3fbea2a08999201959f17238c34..e46f814b1ff3b70f406cd5fdfdf11b27527bf521 100644 (file)
           // string, e.g. "myform.myfield"
           crmUiField: '@',
           // string, an expression producing a printable title
-          crmTitle: '@',
+          crmTitle: '=',
           // string, an expression producing a help id
-          crmHelp: '@'
+          crmHelp: '='
         },
         templateUrl: function(tElement, tAttrs){
           var layout = tAttrs.crmLayout ? tAttrs.crmLayout : 'default';
         link: function (scope, element, attrs, crmUiIdCtrl) {
           $(element).addClass('crm-section');
           scope.crmUiField = attrs.crmUiField;
-          scope.crmTitle = attrs.crmTitle;
-          scope.crmHelp = attrs.crmHelp;
-          scope.crmUiHelpFile = scope.$parent.crmUiHelpFile;
+          scope.crmUiHelpFile = scope.$parent.crmUiHelpFile; // propagate default
         }
       };
     })
index 860454e15ef0816f05daba975cc2300cc3d4476c..5428b7316e9b44ed2dd6f4c45752e02c0c7d6c9a 100644 (file)
@@ -1,7 +1,7 @@
 <label crm-depth="1">
   <span ng-transclude></span>
   <span ng-class="cssClasses">
-    {{$parent.$parent.$eval(crmTitle)}}
+    {{crmTitle}}
   </span>
 </label>
 <div class="clear"></div>
index 7f27ae342d561c6bff286d80f0a3f13558c062bf..5667526b47381ebdd676184674a6a0279510cada 100644 (file)
@@ -1,6 +1,6 @@
 <div class="label">
-  <label crm-ui-for="{{crmUiField}}" crm-depth="1">{{$parent.$parent.$eval(crmTitle)}}</label>
-  <a crm-ui-help="{title: $parent.$parent.$eval(crmTitle), id: $parent.$parent.$eval(crmHelp), file: $parent.crmUiHelpFile}" ng-if="crmHelp"></a>
+  <label crm-ui-for="{{crmUiField}}" crm-depth="1">{{crmTitle}}</label>
+  <a crm-ui-help="{title: crmTitle, id: crmHelp}" ng-if="crmHelp"></a>
 </div>
 <div class="content" ng-transclude></div>
 <div class="clear"></div>