20 lines
420 B
CoffeeScript
20 lines
420 B
CoffeeScript
|
$ ->
|
||
|
$(":checkbox").change ->
|
||
|
id = $(this).val()
|
||
|
checked = $(this).is(":checked")
|
||
|
url = $(this).data("url")
|
||
|
$.ajax
|
||
|
type: "PUT"
|
||
|
url: url
|
||
|
dataType: "json"
|
||
|
data:
|
||
|
id: id
|
||
|
developers_can_push: checked
|
||
|
|
||
|
success: ->
|
||
|
new Flash("Branch updated.", "notice")
|
||
|
location.reload true
|
||
|
|
||
|
error: ->
|
||
|
new Flash("Failed to update branch!", "alert")
|