Commit 9fd06180 authored by Marin Jankovski's avatar Marin Jankovski

Update on the correct checkbox.

parent 16ebeede
$ -> $ ->
$(":checkbox").change -> $(":checkbox").change ->
id = $(this).val() name = $(this).attr("name")
checked = $(this).is(":checked") if name == "developers_can_push"
url = $(this).data("url") id = $(this).val()
$.ajax checked = $(this).is(":checked")
type: "PUT" url = $(this).data("url")
url: url $.ajax
dataType: "json" type: "PUT"
data: url: url
id: id dataType: "json"
developers_can_push: checked data:
id: id
developers_can_push: checked
success: -> success: ->
new Flash("Branch updated.", "notice") new Flash("Branch updated.", "notice")
location.reload true location.reload true
error: -> error: ->
new Flash("Failed to update branch!", "alert") new Flash("Failed to update branch!", "alert")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment