Changed active status color in top menu

stable
Daniel García 2018-11-22 19:24:20 +01:00 committed by Alex Hermida
parent e621d93557
commit e89cf91654
7 changed files with 40 additions and 16 deletions

View File

@ -45,7 +45,9 @@ DropdownNotificationsDirective = ($rootScope, notificationsService, currentUserS
directive = { directive = {
templateUrl: "navigation-bar/dropdown-notifications/dropdown-notifications.html" templateUrl: "navigation-bar/dropdown-notifications/dropdown-notifications.html"
scope: true scope: {
active: "="
}
link: link link: link
} }

View File

@ -3,6 +3,7 @@ a(
title="{{ 'EVENTS.TITLE' | translate }}" title="{{ 'EVENTS.TITLE' | translate }}"
tg-nav="notifications" tg-nav="notifications"
ng-mouseover="visible=true" ng-mouseover="visible=true"
ng-class="{'active': active}"
) )
tg-svg(svg-icon="icon-bell") tg-svg(svg-icon="icon-bell")
div.counter(ng-if="total", ng-class="{'active': newEvent}") {{ total }} div.counter(ng-if="total", ng-class="{'active': newEvent}") {{ total }}

View File

@ -28,7 +28,9 @@ DropdownProjectListDirective = (currentUserService, projectsService) ->
directive = { directive = {
templateUrl: "navigation-bar/dropdown-project-list/dropdown-project-list.html" templateUrl: "navigation-bar/dropdown-project-list/dropdown-project-list.html"
scope: {} scope: {
active: "="
}
link: link link: link
} }

View File

@ -2,6 +2,7 @@ a(
href="" href=""
title="Projects" title="Projects"
tg-nav="projects" tg-nav="projects"
ng-class="{'active': active}"
) )
tg-svg(svg-icon="icon-project") tg-svg(svg-icon="icon-project")

View File

@ -34,10 +34,16 @@ NavigationBarDirective = (currentUserService, navigationBarService, locationServ
locationService.search({next: nextUrl}) locationService.search({next: nextUrl})
scope.$on "$routeChangeSuccess", () -> scope.$on "$routeChangeSuccess", () ->
if locationService.path() == "/" scope.vm.active = null
scope.vm.active = true switch locationService.path()
else when "/"
scope.vm.active = false scope.vm.active = 'dashboard'
when "/discover"
scope.vm.active = 'discover'
when "/notifications"
scope.vm.active = 'notifications'
when "/projects/"
scope.vm.active = 'projects'
directive = { directive = {
templateUrl: "navigation-bar/navigation-bar.html" templateUrl: "navigation-bar/navigation-bar.html"

View File

@ -41,23 +41,27 @@ nav.navbar(ng-if="vm.isEnabledHeader")
div.nav-right(ng-if="vm.isAuthenticated") div.nav-right(ng-if="vm.isAuthenticated")
a( a(
tg-nav="home" tg-nav="home"
ng-class="{active: vm.active}" ng-class="{'active': vm.active == 'dashboard' }"
title="{{'PROJECT.NAVIGATION.DASHBOARD_TITLE' | translate}}" title="{{'PROJECT.NAVIGATION.DASHBOARD_TITLE' | translate}}"
) )
tg-svg(svg-icon="icon-dashboard") tg-svg(svg-icon="icon-dashboard")
a( a(
href="#", href="#",
tg-nav="discover", tg-nav="discover",
ng-class="{active: vm.active}" ng-class="{'active': vm.active == 'discover' }"
title="{{'PROJECT.NAVIGATION.DISCOVER_TITLE' | translate}}", title="{{'PROJECT.NAVIGATION.DISCOVER_TITLE' | translate}}",
) )
tg-svg(svg-icon="icon-discover") tg-svg(svg-icon="icon-discover")
div.topnav-dropdown-wrapper(ng-show="vm.projects.size", tg-dropdown-project-list) div.topnav-dropdown-wrapper(
ng-show="vm.projects.size"
tg-dropdown-project-list
active="vm.active == 'projects'"
)
div.topnav-dropdown-wrapper( div.topnav-dropdown-wrapper(
tg-dropdown-notifications tg-dropdown-notifications
active="vm.active == 'notifications'"
) )
div.topnav-dropdown-wrapper(tg-dropdown-user) div.topnav-dropdown-wrapper(tg-dropdown-user)

View File

@ -40,7 +40,12 @@ $dropdown-width: 350px;
> a, > a,
.topnav-dropdown-wrapper > a { .topnav-dropdown-wrapper > a {
color: $white; color: $white;
padding: .5rem 2rem; margin: 0 .75rem;
padding: .5rem 1rem;
}
.active {
background: rgba($white, .95);
color: $secondary-dark;
} }
svg { svg {
@include svg-size(1.2rem); @include svg-size(1.2rem);
@ -48,24 +53,27 @@ $dropdown-width: 350px;
transition: all .2s linear; transition: all .2s linear;
} }
} }
> a, .nav-right > a,
.topnav-dropdown-wrapper > a { .topnav-dropdown-wrapper > a {
color: $white; color: $white;
display: inline-block; display: inline-block;
transition: all .2s linear; transition: all .2s linear;
&:hover { &:hover:not(.user-avatar) {
background: rgba($black, .2); background: rgba($white, .95);
color: $primary-light; color: $primary-light;
svg { svg {
fill: $white; fill: $primary-light;
transition: all .2s linear;
} }
} }
&.user-avatar { &.user-avatar {
min-width: 200px; min-width: 200px;
padding: 0; padding: 0;
padding-left: 2rem; padding-left: 2rem;
text-align: right; text-align: right;
&:hover {
background: rgba($black, .2);
}
span { span {
padding-right: 1rem; padding-right: 1rem;
} }