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
|
prev_level = policy.notify_level
|
||||||
policy.notify_level = parseInt(target.val(), 10)
|
policy.notify_level = parseInt(target.val(), 10)
|
||||||
|
|
||||||
$repo.save(policy).then ->
|
onSuccess = ->
|
||||||
$repo.save(policy).then null, ->
|
$confirm.notify("success")
|
||||||
|
|
||||||
|
onError = ->
|
||||||
$confirm.notify("error")
|
$confirm.notify("error")
|
||||||
target.parents(".policy-table-row").find("input[value=#{prev_level}]").prop("checked", true)
|
target.parents(".policy-table-row").find("input[value=#{prev_level}]").prop("checked", true)
|
||||||
|
|
||||||
|
$repo.save(policy).then(onSuccess, onError)
|
||||||
|
|
||||||
$scope.$on "$destroy", ->
|
$scope.$on "$destroy", ->
|
||||||
$el.off()
|
$el.off()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue