diff --git a/app/coffee/modules/nav.coffee b/app/coffee/modules/nav.coffee index d76497c0..a80bf6d4 100644 --- a/app/coffee/modules/nav.coffee +++ b/app/coffee/modules/nav.coffee @@ -317,6 +317,22 @@ ProjectMenuDirective = ($log, $compile, $auth, $rootscope, $tgAuth, $location, $
""") + # 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(), diff --git a/app/partials/task-detail.jade b/app/partials/task-detail.jade index c9d4e80e..25cf5c73 100644 --- a/app/partials/task-detail.jade +++ b/app/partials/task-detail.jade @@ -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 diff --git a/app/partials/us-detail.jade b/app/partials/us-detail.jade index 2bb65166..6685ae9a 100644 --- a/app/partials/us-detail.jade +++ b/app/partials/us-detail.jade @@ -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