{/if}
{if $contactSmartGroupSettings neq 3}
+ <div class="spacer" style="height: 1.5em;"></div>
<div class="accordion ui-accordion ui-widget ui-helper-reset">
<div class="crm-accordion-wrapper crm-ajax-accordion crm-smartgroup-accordion {if $contactSmartGroupSettings eq 1}collapsed{/if}">
<div class="crm-accordion-header" id="crm-contact_smartgroup" contact_id="{$contactId}">
</div>
<!-- /.crm-accordion-header -->
<div class="crm-accordion-body">
- <div class="crm-contact_smartgroup"></div>
+ <div class="crm-contact_smartgroup" style="min-height: 3em;"></div>
</div>
<!-- /.crm-accordion-body -->
</div>
CRM.$(function($) {
// load panes function calls for snippet based on id of crm-accordion-header
function loadPanes() {
- var id = $(this).attr('id');
+ var $el = $(this).parent().find('div.crm-contact_smartgroup');
var contactId = $(this).attr('contact_id');
- if (!$('div.' + id).html()) {
- var loading = '<img src="{/literal}{$config->resourceBase}i/loading.gif{literal}" alt="{/literal}{ts escape='js'}loading{/ts}{literal}" /> {/literal}{ts escape='js'}Loading{/ts}{literal}...';
- $('div.' + id).html(loading).load(CRM.url('civicrm/contact/view/smartgroup', {snippet: 4, cid: contactId}));
+ if (!$el.html()) {
+ CRM.loadPage(CRM.url('civicrm/contact/view/smartgroup', {cid: contactId}), {target: $el});
}
}
// bind first click of accordion header to load crm-accordion-body with snippet