-(function($) {
+(function($, _) {
var ufGroupCollection = new CRM.UF.UFGroupCollection(_.sortBy(CRM.initialProfileList.values, 'title'));
//var ufGroupCollection = new CRM.UF.UFGroupCollection(CRM.initialProfileList.values, {
// comparator: 'title' // no point, this doesn't work with subcollections
});
view.on('change:ufGroupId', function() {
$(select).val(view.getUfGroupId()).change();
- })
+ });
view.render();
$(select).after(view.el);
setTimeout(function() {
});
};
- // FIXME: this needs a better place to live
- CRM.scanProfileSelectors = function() {
- $('.crm-profile-selector').each(function(){
+ $('#crm-container').on('crmLoad', function() {
+ $('.crm-profile-selector:not(.rendered)', this).addClass('rendered').each(function() {
$(this).crmProfileSelector({
groupTypeFilter: $(this).attr('data-group-type'),
entities: $(this).data('entities')
});
});
- };
+ });
-})(cj);
+})(CRM.$, CRM._);