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

Commit

Permalink
Merge pull request #226 from gskema/dev
Browse files Browse the repository at this point in the history
[-] MO: Add JavaSCript workaround to expand active category tree line
  • Loading branch information
gskema committed Jun 9, 2016
2 parents 1419f2e + 50cb66c commit a2c5aad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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

0 comments on commit a2c5aad

Please sign in to comment.