diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index 8d2bd6dd..c3dae556 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -106,7 +106,7 @@ module.controller("ProjectProfileController", ProjectProfileController) ## Project Profile Directive ############################################################################# -ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) -> +ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectsService) -> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley({"onlyOneErrorElement": true}) submit = debounce 2000, (event) => @@ -123,6 +123,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) -> newUrl = $navurls.resolve("project-admin-project-profile-details", {project: $scope.project.slug}) $location.path(newUrl) $scope.$emit("project:loaded", $scope.project) + projectsService.fetchProjects() promise.then null, (data) -> $loading.finish(submitButton) @@ -136,8 +137,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) -> return {link:link} -module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", - ProjectProfileDirective]) +module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", "tgProjects", ProjectProfileDirective]) ############################################################################# ## Project Default Values Directive diff --git a/app/coffee/modules/projects/lightboxes.coffee b/app/coffee/modules/projects/lightboxes.coffee index 03f8273a..655228b6 100644 --- a/app/coffee/modules/projects/lightboxes.coffee +++ b/app/coffee/modules/projects/lightboxes.coffee @@ -150,7 +150,7 @@ module.directive("tgLbCreateProject", ["$rootScope", "$tgRepo", "$tgConfirm", ## Delete Project Lightbox Directive ############################################################################# -DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confirm, lightboxService, tgLoader) -> +DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confirm, lightboxService, tgLoader, projectsService) -> link = ($scope, $el, $attrs) -> projectToDelete = null $scope.$on "deletelightbox:new", (ctx, project)-> @@ -171,6 +171,7 @@ DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confir $rootscope.$broadcast("projects:reload") $location.path($navUrls.resolve("home")) $confirm.notify("success") + projectsService.fetchProjects() # FIXME: error handling? promise.then null, -> @@ -188,4 +189,4 @@ DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confir return {link:link} module.directive("tgLbDeleteProject", ["$tgRepo", "$rootScope", "$tgAuth", "$tgLocation", "$tgNavUrls", - "$tgConfirm", "lightboxService", "tgLoader", DeleteProjectDirective]) + "$tgConfirm", "lightboxService", "tgLoader", "tgProjects", DeleteProjectDirective])