debian-mirror-gitlab/app/assets/javascripts/issues.js.coffee

39 lines
1.1 KiB
CoffeeScript
Raw Normal View History

2014-09-02 18:07:02 +05:30
@Issues =
init: ->
2016-06-02 11:05:42 +05:30
Issues.created = true
2014-09-02 18:07:02 +05:30
Issues.initChecks()
$("body").on "ajax:success", ".close_issue, .reopen_issue", ->
t = $(this)
totalIssues = undefined
reopen = t.hasClass("reopen_issue")
$(".issue_counter").each ->
issue = $(this)
totalIssues = parseInt($(this).html(), 10)
if reopen and issue.closest(".main_menu").length
$(this).html totalIssues + 1
else
$(this).html totalIssues - 1
initChecks: ->
$(".check_all_issues").click ->
$(".selected_issue").prop("checked", @checked)
Issues.checkChanged()
$(".selected_issue").bind "change", Issues.checkChanged
checkChanged: ->
checked_issues = $(".selected_issue:checked")
if checked_issues.length > 0
ids = []
$.each checked_issues, (index, value) ->
ids.push $(value).attr("data-id")
$("#update_issues_ids").val ids
2015-04-26 12:48:37 +05:30
$(".issues-other-filters").hide()
2014-09-02 18:07:02 +05:30
$(".issues_bulk_update").show()
else
$("#update_issues_ids").val []
$(".issues_bulk_update").hide()
2015-04-26 12:48:37 +05:30
$(".issues-other-filters").show()