Merge pull request #182 from taigaio/bug/1706/preserve-navigation-active-in-us-and-task
fix #1706 preserve navigation active in US and tasksstable
commit
6362a711aa
|
@ -317,6 +317,22 @@ ProjectMenuDirective = ($log, $compile, $auth, $rootscope, $tgAuth, $location, $
|
|||
<div class="menu-container"></div>
|
||||
""")
|
||||
|
||||
# If the last page was kanban or backlog and
|
||||
# the new one is the task detail or the us details
|
||||
# this method preserve the last section name.
|
||||
getSectionName = ($el, sectionName, project) ->
|
||||
oldSectionName = $el.find("a.active").parent().attr("id")?.replace("nav-", "")
|
||||
|
||||
if sectionName == "backlog-kanban"
|
||||
if oldSectionName in ["backlog", "kanban"]
|
||||
sectionName = oldSectionName
|
||||
else if project.is_backlog_activated && !project.is_kanban_activated
|
||||
sectionName = "backlog"
|
||||
else if !project.is_backlog_activated && project.is_kanban_activated
|
||||
sectionName = "kanban"
|
||||
|
||||
return sectionName
|
||||
|
||||
renderMainMenu = ($el) ->
|
||||
html = mainTemplate({})
|
||||
$el.html(html)
|
||||
|
@ -326,7 +342,7 @@ ProjectMenuDirective = ($log, $compile, $auth, $rootscope, $tgAuth, $location, $
|
|||
# content loaded signal is raised using inner scope.
|
||||
renderMenuEntries = ($el, targetScope, project={}) ->
|
||||
container = $el.find(".menu-container")
|
||||
sectionName = targetScope.section
|
||||
sectionName = getSectionName($el, targetScope.section, project)
|
||||
|
||||
ctx = {
|
||||
user: $auth.getUser(),
|
||||
|
|
|
@ -5,7 +5,7 @@ block head
|
|||
|
||||
block content
|
||||
div.wrapper(ng-controller="TaskDetailController as ctrl",
|
||||
ng-init="section='backlog'")
|
||||
ng-init="section='backlog-kanban'")
|
||||
div.main.us-detail
|
||||
div.us-detail-header.header-with-actions
|
||||
include views/components/mainTitle
|
||||
|
|
|
@ -5,7 +5,7 @@ block head
|
|||
|
||||
block content
|
||||
div.wrapper(ng-controller="UserStoryDetailController as ctrl",
|
||||
ng-init="section='backlog'")
|
||||
ng-init="section='backlog-kanban'")
|
||||
div.main.us-detail
|
||||
div.us-detail-header.header-with-actions
|
||||
include views/components/mainTitle
|
||||
|
|
Loading…
Reference in New Issue