Restores 'active' display script function that was lost during <details> conversion
authorNicol <vingle@users.noreply.github.com>
Wed, 6 Dec 2023 21:03:33 +0000 (21:03 +0000)
committerGitHub <noreply@github.com>
Wed, 6 Dec 2023 21:03:33 +0000 (21:03 +0000)
templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl

index bf35354899e0e67937f90e2631f8d7b4e95e9ec8..e8f459bad56051a133a9b74ac5e3814764c528ff 100644 (file)
@@ -24,6 +24,7 @@ CRM.$(function($) {
     var header = $(this).parent();
     header.next().html('');
     header.removeClass('active');
+    header.parent('.crm-ajax-accordion:not(.collapsed)').crmAccordionToggle();
     // Reset results-display mode if it depends on this pane
     var mode = modes[$('#component_mode').val()] || null;
     if (mode && header.attr('id') == mode) {
@@ -110,7 +111,7 @@ CRM.$(function($) {
     </div>
   </details>
   {foreach from=$allPanes key=paneName item=paneValue}
-    <details class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion">
+    <details class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open eq 'true' || array_key_exists($paneName, $openedPanes)} {else}collapsed{/if}">
       <summary class="crm-accordion-header" id="{$paneValue.id}">
         {$paneName}
       </summary>