Watch project list homepage changes

stable
Álex Hermida 2018-11-27 11:46:52 +01:00 committed by Alex Hermida
parent e050b31156
commit 66b4e4971f
2 changed files with 10 additions and 2 deletions

View File

@ -35,6 +35,7 @@ module = angular.module("taigaUserSettings")
class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMixin) class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMixin)
@.$inject = [ @.$inject = [
"$rootScope"
"$scope" "$scope"
"$tgSections" "$tgSections"
"$tgResources" "$tgResources"
@ -43,7 +44,7 @@ class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMi
"tgCurrentUserService" "tgCurrentUserService"
] ]
constructor: (@scope, @tgSections, @rs, @repo, @confirm, @currentUserService) -> constructor: (@rootScope, @scope, @tgSections, @rs, @repo, @confirm, @currentUserService) ->
@scope.sections = @tgSections.list() @scope.sections = @tgSections.list()
promise = @.loadInitialData() promise = @.loadInitialData()
@ -56,6 +57,7 @@ class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMi
updateCustomHomePage: (projectSettings) -> updateCustomHomePage: (projectSettings) ->
onSuccess = => onSuccess = =>
@currentUserService.loadProjects() @currentUserService.loadProjects()
@rootScope.$broadcast("dropdown-project-list:updated")
@confirm.notify("success") @confirm.notify("success")
onError = => onError = =>

View File

@ -17,7 +17,7 @@
# File: navigation-bar/dropdown-project-list/dropdown-project-list.directive.coffee # File: navigation-bar/dropdown-project-list/dropdown-project-list.directive.coffee
### ###
DropdownProjectListDirective = (currentUserService, projectsService) -> DropdownProjectListDirective = (rootScope, currentUserService, projectsService) ->
link = (scope, el, attrs, ctrl) -> link = (scope, el, attrs, ctrl) ->
scope.vm = {} scope.vm = {}
@ -26,6 +26,11 @@ DropdownProjectListDirective = (currentUserService, projectsService) ->
scope.vm.newProject = -> scope.vm.newProject = ->
projectsService.newProject() projectsService.newProject()
updateLinks = ->
el.find(".dropdown-project-list ul li a").data("fullUrl", "")
rootScope.$on("dropdown-project-list:updated", updateLinks)
directive = { directive = {
templateUrl: "navigation-bar/dropdown-project-list/dropdown-project-list.html" templateUrl: "navigation-bar/dropdown-project-list/dropdown-project-list.html"
scope: { scope: {
@ -37,6 +42,7 @@ DropdownProjectListDirective = (currentUserService, projectsService) ->
return directive return directive
DropdownProjectListDirective.$inject = [ DropdownProjectListDirective.$inject = [
"$rootScope",
"tgCurrentUserService", "tgCurrentUserService",
"tgProjectsService" "tgProjectsService"
] ]