Merge pull request #563 from taigaio/issue/2991/update-watchers-after-new-comment

Issue/2991/update watchers after new comment
stable
David Barragán Merino 2015-07-02 18:41:49 +02:00
commit 75eb8b7cf1
4 changed files with 12 additions and 2 deletions

View File

@ -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])

View File

@ -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")

View File

@ -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}

View File

@ -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)