// 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
}
};
})
<label crm-depth="1">
<span ng-transclude></span>
<span ng-class="cssClasses">
- {{$parent.$parent.$eval(crmTitle)}}
+ {{crmTitle}}
</span>
</label>
<div class="clear"></div>
<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>