Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

[-] MO: Add JavaSCript workaround to expand active category tree line #226

Merged
merged 1 commit into from
Jun 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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');

});

});
Expand Down
Original file line number Diff line number Diff line change
@@ -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}
<div class="list-group-item-wrapper{if (isset($currentCategoryId) && $list_item.id == $currentCategoryId) || (!empty($list_item.expanded) && $list_item.expanded)} active{/if}">
Expand Down