diff --git a/app/coffee/modules/common/history.coffee b/app/coffee/modules/common/history.coffee index 7f17687d..d056cc6c 100644 --- a/app/coffee/modules/common/history.coffee +++ b/app/coffee/modules/common/history.coffee @@ -68,7 +68,7 @@ class HistoryController extends taiga.Controller return @rs.history.undeleteComment(type, objectId, activityId).then => @.loadHistory(type, objectId) -HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $compile, $navUrls) -> +HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $compile, $navUrls, $rootScope) -> templateChangeDiff = $template.get("common/history/history-change-diff.html", true) templateChangePoints = $template.get("common/history/history-change-points.html", true) templateChangeGeneric = $template.get("common/history/history-change-generic.html", true) @@ -348,6 +348,8 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c $el.find(".comment-list").addClass("activeanimation") onSuccess = -> + $rootScope.$broadcast("comment:new") + $ctrl.loadHistory(type, objectId).finally -> $loading.finish(target) @@ -456,4 +458,4 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c module.directive("tgHistory", ["$log", "$tgLoading", "$tgQqueue", "$tgTemplate", "$tgConfirm", "$translate", - "$compile", "$tgNavUrls", HistoryDirective]) + "$compile", "$tgNavUrls", "$rootScope", HistoryDirective]) diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index 7fd33d1a..6dda40b4 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -97,6 +97,9 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin) @rootscope.$broadcast("object:updated") @.loadIssue() + @scope.$on "comment:new", => + @.loadIssue() + @scope.$on "custom-attributes-values:edit", => @rootscope.$broadcast("object:updated") diff --git a/app/coffee/modules/tasks/detail.coffee b/app/coffee/modules/tasks/detail.coffee index 5188f767..d9864bbf 100644 --- a/app/coffee/modules/tasks/detail.coffee +++ b/app/coffee/modules/tasks/detail.coffee @@ -84,6 +84,8 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin) @rootscope.$broadcast("object:updated") @scope.$on "custom-attributes-values:edit", => @rootscope.$broadcast("object:updated") + @scope.$on "comment:new", => + @.loadTask() initializeOnDeleteGoToUrl: -> ctx = {project: @scope.project.slug} diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee index 4e0725e8..c4a5dfa7 100644 --- a/app/coffee/modules/userstories/detail.coffee +++ b/app/coffee/modules/userstories/detail.coffee @@ -103,6 +103,9 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin) @scope.$on "custom-attributes-values:edit", => @rootscope.$broadcast("object:updated") + @scope.$on "comment:new", => + @.loadUs() + initializeOnDeleteGoToUrl: -> ctx = {project: @scope.project.slug} @scope.onDeleteGoToUrl = @navUrls.resolve("project", ctx)