From 199d7fc4be42809c13cf0f6d7f4c865e0a1f1b31 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 22 Aug 2014 13:28:37 +0200 Subject: [PATCH] fix remove watcher --- app/coffee/modules/common/components.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/common/components.coffee b/app/coffee/modules/common/components.coffee index d19ed0cb..f7bd3dd2 100644 --- a/app/coffee/modules/common/components.coffee +++ b/app/coffee/modules/common/components.coffee @@ -165,9 +165,12 @@ WatchersDirective = ($rootscope, $confirm) -> subtitle = $scope.usersById[watcherId].full_name_display $confirm.ask(title, subtitle).then => - watcherIds = _.clone($model.$modelValue, false) + watcherIds = _.clone($model.$modelValue.watchers, false) watcherIds = _.pull(watcherIds, watcherId) - $model.$setViewValue(watcherIds) + + item = $model.$modelValue.clone() + item.watchers = watcherIds + $model.$setViewValue(item) $el.on "click", ".add-watcher", (event) -> event.preventDefault()