select dashboard icon

stable
Juanfran 2015-05-28 08:06:03 +02:00
parent 4b96a53108
commit 3acc1b8ba9
3 changed files with 13 additions and 6 deletions

View File

@ -1,7 +1,13 @@
NavigationBarDirective = (currentUserService) ->
NavigationBarDirective = (currentUserService, $location) ->
link = (scope, el, attrs, ctrl) ->
scope.vm = {}
scope.$on "$routeChangeSuccess", () ->
if $location.path() == "/"
scope.vm.active = true
else
scope.vm.active = false
taiga.defineImmutableProperty(scope.vm, "projects", () -> currentUserService.projects.get("recents"))
taiga.defineImmutableProperty(scope.vm, "isAuthenticated", () -> currentUserService.isAuthenticated())
@ -14,7 +20,8 @@ NavigationBarDirective = (currentUserService) ->
return directive
NavigationBarDirective.$inject = [
"tgCurrentUserService"
"tgCurrentUserService",
"$location"
]
angular.module("taigaNavigationBar").directive("tgNavigationBar", NavigationBarDirective)

View File

@ -19,10 +19,9 @@ nav.navbar(ng-if="vm.isAuthenticated")
translate="PROJECT.NAVIGATION.HELP")
div.nav-right
a(
href="#",
tg-nav="home",
title="{{'PROJECT.NAVIGATION.DASHBOARD_TITLE' | translate}}")
a(tg-nav="home",
ng-class="{active: vm.active}",
title="{{'PROJECT.NAVIGATION.DASHBOARD_TITLE' | translate}}")
include ../../svg/dashboard.svg

View File

@ -47,6 +47,7 @@
color: $white;
display: inline-block;
transition: all .2s linear;
&.active,
&:hover {
background: rgba($black, .2);
color: $fresh-taiga;