From 9873b1ed94196fe5ab86107d2186bafac68c51bb Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 7 Oct 2015 13:33:57 +0200 Subject: [PATCH] refactor main-navigation to menu --- .../_dashboard/first_steps_clues.coffee | 4 +- .../app/controllers/layout_ref.coffee | 4 +- .../app/controllers/navigation.coffee | 8 ++-- .../javascripts/app/views/navigation.jst.eco | 2 +- .../app/views/navigation/menu.jst.eco | 39 +++++++++---------- 5 files changed, 27 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee b/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee index 9792e3277..db2f3cb78 100644 --- a/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee +++ b/app/assets/javascripts/app/controllers/_dashboard/first_steps_clues.coffee @@ -30,7 +30,7 @@ class App.FirstStepsClues extends App.Controller ] } { - container: '.main-navigation .overviews' + container: '.js-overviewsMenuItem' headline: 'Overviews' text: 'Here you find your ticket overviews for open, my assigned or escalated tickets.' #headline: 'Übersichten' @@ -40,7 +40,7 @@ class App.FirstStepsClues extends App.Controller ] } { - container: '.main-navigation .dashboard' + container: '.js-dashboardMenuItem' headline: 'Dashboard' text: 'Here you see a quick overview about your and other agents performance.' #headline: 'Dashboard' diff --git a/app/assets/javascripts/app/controllers/layout_ref.coffee b/app/assets/javascripts/app/controllers/layout_ref.coffee index b9f3a172c..af779b064 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.coffee @@ -1020,7 +1020,7 @@ class CluesRef extends App.ControllerContent ] } { - container: '.main-navigation .overviews' + container: '.js-overviewsMenuItem' headline: 'Übersichten' text: 'Hier findest du eine Liste aller Tickets.' actions: [ @@ -1028,7 +1028,7 @@ class CluesRef extends App.ControllerContent ] } { - container: '.main-navigation .dashboard' + container: '.js-dashboardMenuItem' headline: 'Dashboard' text: 'Hier siehst du auf einem Blick ob sich alle Agenten an die Spielregeln halten.' actions: [ diff --git a/app/assets/javascripts/app/controllers/navigation.coffee b/app/assets/javascripts/app/controllers/navigation.coffee index 35e307308..3291f4050 100644 --- a/app/assets/javascripts/app/controllers/navigation.coffee +++ b/app/assets/javascripts/app/controllers/navigation.coffee @@ -52,11 +52,11 @@ class App.Navigation extends App.ControllerWidgetPermanent # get active tabs to reactivate on rerender active_tab = {} - @$('.active').children('a').each( (i,d) -> + @$('.is-active').each( (i,d) -> href = $(d).attr('href') active_tab[href] = true ) - @$('.main-navigation').html App.view('navigation/menu')( + @$('.js-menu').html App.view('navigation/menu')( items: items open_tab: open_tab active_tab: active_tab @@ -353,8 +353,8 @@ class App.Navigation extends App.ControllerWidgetPermanent @addPrioCount newlist, item update: (url) => - @$('li').removeClass('active') - @$("[href=\"#{url}\"]").parents('li').addClass('active') + @$('.is-active').removeClass('is-active') + @$("[href=\"#{url}\"]").addClass('is-active') recentViewNavbarItemsRebuild: => diff --git a/app/assets/javascripts/app/views/navigation.jst.eco b/app/assets/javascripts/app/views/navigation.jst.eco index fa83a8520..0c720e542 100644 --- a/app/assets/javascripts/app/views/navigation.jst.eco +++ b/app/assets/javascripts/app/views/navigation.jst.eco @@ -13,7 +13,7 @@ - +
diff --git a/app/assets/javascripts/app/views/navigation/menu.jst.eco b/app/assets/javascripts/app/views/navigation/menu.jst.eco index eb038e3cc..8f39ef7e9 100644 --- a/app/assets/javascripts/app/views/navigation/menu.jst.eco +++ b/app/assets/javascripts/app/views/navigation/menu.jst.eco @@ -1,9 +1,8 @@ <% for item in @items: %> <% if item.child: %> - <% else: %> - > - - <%- @Icon(item.class, 'nav-icon') %> - - <%- @T(item.name) %> - - <% if item.counter: %> - - <% end %> - <% if item.switch: %> -
- - -
- <% end %> -
- + + <%- @Icon(item.class, 'menu-item-icon') %> + + <%- @T(item.name) %> + + <% if item.counter: %> + + <% end %> + <% if item.switch: %> + + + + + <% end %> + <% end %> <% end %> \ No newline at end of file