diff --git a/themes/community-theme-16/modules/blockcategories/blockcategories.tpl b/themes/community-theme-16/modules/blockcategories/blockcategories.tpl index decb8e7a..1c9bdb74 100644 --- a/themes/community-theme-16/modules/blockcategories/blockcategories.tpl +++ b/themes/community-theme-16/modules/blockcategories/blockcategories.tpl @@ -47,6 +47,12 @@ $(function() { $triggers.filter('[href="#' + $(this).prop('id') + '"],' + '[data-target="#' + $(this).prop('id') + '"]').parent().removeClass('active'); }); + + // JavaScript workaround for expanding the active category tree line. + // Preferably you should use an override and return expanded tree from the server side + // @see themes/community-theme-16/modules/blockcategories/list_group_item.tpl + $('.list-group-item.current').parents('.collapse').collapse('show'); + }); }); diff --git a/themes/community-theme-16/modules/blockcategories/list_group_item.tpl b/themes/community-theme-16/modules/blockcategories/list_group_item.tpl index f27a39f8..7c551058 100644 --- a/themes/community-theme-16/modules/blockcategories/list_group_item.tpl +++ b/themes/community-theme-16/modules/blockcategories/list_group_item.tpl @@ -1,3 +1,9 @@ +{* + * ATENTION! If you would like to have active categories already expanded before the JavaScript loads, + * You must calculate whichs categories should be expanded by override a method in BlockCategories module. + * You may use this override: https://gist.github.com/anonymous/7715d13eb74424075c95d880089e8200 + * If you decide to use it, don't forget to remove the JavaScript part which expands the active category. + *} {if !empty($list_item.children)} {$list_item_id = 'ct-'|cat:$list_item.id}