fix remove watcher

stable
Juanfran 2014-08-22 13:28:37 +02:00
parent 2b216e4fd8
commit 199d7fc4be
1 changed files with 5 additions and 2 deletions

View File

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