Skip to content

Commit

Permalink
Added an ability to make an active menu item via active attribute (Close
Browse files Browse the repository at this point in the history
 #20)
  • Loading branch information
fps01 committed Jul 10, 2017
1 parent ec02c7e commit f4c29e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Yii2 Gentelella Change Log
1.3.0 Under development
-----------------------

1.2.4 July 10, 2017
-------------------

- Enh #20: Added an ability to make an active menu item via `active` attribute (fps01)

1.2.3 July 4, 2017
------------------

Expand Down
3 changes: 3 additions & 0 deletions assets/src/js/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

GentelellaExtension = {
'init': function () {
$SIDEBAR_MENU.find('li.active').addClass('current-page').parents('ul').parent().addClass('active');
if (this.getCookie('menuIsCollapsed') == 'true') {
jQuery('#menu_toggle').trigger('click');
} else {
$SIDEBAR_MENU.find('li.active').parents('ul').slideDown();
}
jQuery('#menu_toggle').click(function() {
GentelellaExtension.setCookie('menuIsCollapsed', jQuery('body').hasClass('nav-sm'), undefined, '/');
Expand Down

0 comments on commit f4c29e8

Please sign in to comment.