Show a confirm message when a project notification is changed
parent
3b452ea279
commit
ea53e08a21
|
@ -143,11 +143,15 @@ UserNotificationsListDirective = ($repo, $confirm) ->
|
|||
prev_level = policy.notify_level
|
||||
policy.notify_level = parseInt(target.val(), 10)
|
||||
|
||||
$repo.save(policy).then ->
|
||||
$repo.save(policy).then null, ->
|
||||
onSuccess = ->
|
||||
$confirm.notify("success")
|
||||
|
||||
onError = ->
|
||||
$confirm.notify("error")
|
||||
target.parents(".policy-table-row").find("input[value=#{prev_level}]").prop("checked", true)
|
||||
|
||||
$repo.save(policy).then(onSuccess, onError)
|
||||
|
||||
$scope.$on "$destroy", ->
|
||||
$el.off()
|
||||
|
||||
|
|
Loading…
Reference in New Issue