From f40b9acc92ce0554d4a10162e3e3c8ecfb62207d Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 1 Feb 2016 08:41:11 +0100 Subject: [PATCH] reload US if the status has changed --- app/coffee/modules/userstories/detail.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee index 08468dc8..997ca0bb 100644 --- a/app/coffee/modules/userstories/detail.coffee +++ b/app/coffee/modules/userstories/detail.coffee @@ -94,6 +94,10 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin) initializeEventHandlers: -> @scope.$on "related-tasks:update", => @scope.tasks = _.clone(@scope.tasks, false) + allClosed = _.every @scope.tasks, (task) -> return task.is_closed + + if @scope.us.is_closed != allClosed + @.loadUs() @scope.$on "attachment:create", => @analytics.trackEvent("attachment", "create", "create attachment on userstory", 1)