From 76660c77f27875bda786b99501f791d1bc4c7589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Sat, 4 Oct 2014 19:25:54 +0200 Subject: [PATCH] [backport] Fix bug #1154: Nav-Menu broken affter submit any of the two project profile forms --- app/coffee/modules/admin/project-profile.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index 396facd2..14b3087d 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -96,7 +96,7 @@ module.controller("ProjectProfileController", ProjectProfileController) ## Project Profile Directive ############################################################################# -ProjectProfileDirective = ($rootscope, $log, $repo, $confirm, $loading) -> +ProjectProfileDirective = ($repo, $confirm, $loading) -> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley({"onlyOneErrorElement": true}) submit = (target) => @@ -108,7 +108,7 @@ ProjectProfileDirective = ($rootscope, $log, $repo, $confirm, $loading) -> promise.then -> $loading.finish(target) $confirm.notify("success") - $rootscope.$broadcast("project:loaded", $scope.project) + $scope.$emit("project:loaded", $scope.project) promise.then null, (data) -> $loading.finish(target) @@ -132,14 +132,14 @@ ProjectProfileDirective = ($rootscope, $log, $repo, $confirm, $loading) -> return {link:link} -module.directive("tgProjectProfile", ["$rootScope", "$log", "$tgRepo", "$tgConfirm", "$tgLoading", ProjectProfileDirective]) +module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", ProjectProfileDirective]) ############################################################################# ## Project Modules Directive ############################################################################# -ProjectModulesDirective = ($rootscope, $log, $repo, $confirm, $loading) -> +ProjectModulesDirective = ($repo, $confirm, $loading) -> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley() submit = => @@ -181,4 +181,4 @@ ProjectModulesDirective = ($rootscope, $log, $repo, $confirm, $loading) -> return {link:link} -module.directive("tgProjectModules", ["$rootScope", "$log", "$tgRepo", "$tgConfirm", "$tgLoading", ProjectModulesDirective]) +module.directive("tgProjectModules", ["$tgRepo", "$tgConfirm", "$tgLoading", ProjectModulesDirective])