-
Notifications
You must be signed in to change notification settings - Fork 506
Description
Expected behaviour
Global navigation item "Settings" should be highlighted in yellow when I go to the a settings page
Actual behaviour
Steps to reproduce the behaviour/error
- Click on any link in the settings-menu, see the settings-item turn grey.
Hints on fixing this issue:
Hint 1 💡 : The navigation-items turn yellow when the active class is set to the element. The html for the mode-bar is here:
https://github.com/ushahidi/platform-client/blob/develop/app/common/directives/mode-bar/mode-bar.html#L42
Hint 2 💡 : ui-sref-active="active"
adds the class 'active' to the <li>
element, but only for the route /settings. Not the subroutes like "/settings/surveys".
Hint 3 💡 : $state.includes('settings')
gives us the information we want instead, this could be combined with ng-class to add the class 'active'. Check for example here: https://github.com/ushahidi/platform-client/blob/develop/app/common/directives/mode-bar/mode-bar.html#L1
Hint 4 💡 : $state needs to be injected to the directive and added to the $scope-variable in order to use it in the template:
https://github.com/ushahidi/platform-client/blob/develop/app/common/directives/mode-bar/mode-bar.directive.js#L9
https://github.com/ushahidi/platform-client/blob/develop/app/common/directives/mode-bar/mode-bar.directive.js#L18
https://github.com/ushahidi/platform-client/blob/develop/app/common/directives/mode-bar/mode-bar.directive.js#L31