X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fjquery%2Fjquery.crmProfileSelector.js;h=7008da85a22b840e1a1827b47d08daf5f464695f;hb=192e8d1a947814993aa699e47ac1669ac17b1045;hp=e150277535074de3f3130e9a849d4c9ed1dce306;hpb=0debcb0f10521f2b7ec95d9fcc86bcd883fbd274;p=civicrm-core.git diff --git a/js/jquery/jquery.crmProfileSelector.js b/js/jquery/jquery.crmProfileSelector.js index e150277535..7008da85a2 100644 --- a/js/jquery/jquery.crmProfileSelector.js +++ b/js/jquery/jquery.crmProfileSelector.js @@ -1,4 +1,4 @@ -(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 @@ -45,7 +45,7 @@ }); view.on('change:ufGroupId', function() { $(select).val(view.getUfGroupId()).change(); - }) + }); view.render(); $(select).after(view.el); setTimeout(function() { @@ -54,14 +54,13 @@ }); }; - // 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._);