Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/highlight active locale menu entry #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"moment": "~2.1.0",
"font-awesome": "4.6.0",
"sass-bootstrap": "~3.0.2",
"mw-uikit": "~1.0.7"
"mw-uikit": "~1.0.12"
},
"resolutions": {
"jquery-ui": "^1.12.1",
Expand Down
4 changes: 4 additions & 0 deletions src/app/modules/main/controllers/main.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ angular.module('mwPortal.Main')
window.localStorage.setItem('locale', id);
};

this.isLocaleActive = function(id){
return i18n.getActiveLocale().id === id;
};

this.getCurrentYear = function () {
return (new Date()).getFullYear();
};
Expand Down
6 changes: 4 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@

<div mw-menu-top-entries right="true">
<div mw-menu-entry
icon="fa-language">
icon="fa-language"
is-active="false">
<div ng-repeat="locale in ctrl.locales">
<div mw-menu-entry
label="{{locale.name}}"
action="ctrl.setLocale(locale.id)">
action="ctrl.setLocale(locale.id)"
is-active="ctrl.isLocaleActive(locale.id)">
</div>
</div>
</div>
Expand Down