Merge pull request #79 from taigaio/bug/1112/error-in-projects-nav-menu
Fix bug #1112: Sometime the nav projects menu doesn't show the project liststable
commit
6ec85fd531
|
@ -52,7 +52,6 @@ class ProjectsNavigationController extends taiga.Controller
|
||||||
return @rs.projects.list().then (projects) =>
|
return @rs.projects.list().then (projects) =>
|
||||||
for project in projects
|
for project in projects
|
||||||
project.url = @projectUrl.get(project)
|
project.url = @projectUrl.get(project)
|
||||||
|
|
||||||
@scope.projects = projects
|
@scope.projects = projects
|
||||||
@scope.filteredProjects = projects
|
@scope.filteredProjects = projects
|
||||||
@scope.filterText = ""
|
@scope.filterText = ""
|
||||||
|
@ -138,9 +137,8 @@ ProjectsNavigationDirective = ($rootscope, animationFrame, $timeout, tgLoader, $
|
||||||
$el.html(html)
|
$el.html(html)
|
||||||
renderProjects($el, projects)
|
renderProjects($el, projects)
|
||||||
|
|
||||||
link = ($scope, $el, $attrs, $ctrl) ->
|
link = ($scope, $el, $attrs, $ctrls) ->
|
||||||
$ctrl = $el.controller()
|
$ctrl = $ctrls[0]
|
||||||
|
|
||||||
$rootscope.$on("project:loaded", hideMenu)
|
$rootscope.$on("project:loaded", hideMenu)
|
||||||
|
|
||||||
overlay.on 'click', () ->
|
overlay.on 'click', () ->
|
||||||
|
@ -189,9 +187,13 @@ ProjectsNavigationDirective = ($rootscope, animationFrame, $timeout, tgLoader, $
|
||||||
$el.trigger("regenerate:pagination")
|
$el.trigger("regenerate:pagination")
|
||||||
|
|
||||||
$scope.$watch "projects", (projects) ->
|
$scope.$watch "projects", (projects) ->
|
||||||
render($el, $scope.projects) if projects?
|
render($el, projects) if projects?
|
||||||
|
|
||||||
|
return {
|
||||||
|
controller: ProjectsNavigationController
|
||||||
|
link: link
|
||||||
|
}
|
||||||
|
|
||||||
return {link: link}
|
|
||||||
|
|
||||||
module.directive("tgProjectsNav", ["$rootScope", "animationFrame", "$timeout", "tgLoader", "$tgLocation",
|
module.directive("tgProjectsNav", ["$rootScope", "animationFrame", "$timeout", "tgLoader", "$tgLocation",
|
||||||
ProjectsNavigationDirective])
|
ProjectsNavigationDirective])
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
div.wizard-create-project(tg-lb-create-project)
|
div.wizard-create-project(tg-lb-create-project)
|
||||||
include wizard-create-project
|
include wizard-create-project
|
||||||
|
|
||||||
nav.projects-nav(ng-controller="ProjectsNavigationController", tg-projects-nav, tg-projects-pagination, projects="projects")
|
nav.projects-nav(tg-projects-nav, tg-projects-pagination, projects="projects")
|
||||||
|
|
Loading…
Reference in New Issue