Welcome to mirror list, hosted at ThFree Co, Russian Federation.

protected_branches.js.coffee « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 14afef2e2ee39034d07d56139bb088a2f3114114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ ->
  $(".protected-branches-list :checkbox").change (e) ->
    name = $(this).attr("name")
    if name == "developers_can_push" || name == "developers_can_merge"
      id = $(this).val()
      can_push = $(this).is(":checked")
      url = $(this).data("url")
      $.ajax
        type: "PATCH"
        url: url
        dataType: "json"
        data:
          id: id
          protected_branch:
            "#{name}": can_push

        success: ->
          row = $(e.target)
          row.closest('tr').effect('highlight')

        error: ->
          new Flash("Failed to update branch!", "alert")