Fixed failing rubocop tests
Fixed issue with issuable checkboxs not being init'd
This commit is contained in:
parent
7eb97ef402
commit
31b1dc3c31
3 changed files with 10 additions and 41 deletions
|
@ -5,6 +5,7 @@ issuable_created = false
|
|||
issuable_created = true
|
||||
Issuable.initTemplates()
|
||||
Issuable.initSearch()
|
||||
Issuable.initChecks()
|
||||
|
||||
initTemplates: ->
|
||||
Issuable.labelRow = _.template(
|
||||
|
@ -62,11 +63,17 @@ issuable_created = false
|
|||
dataType: "json"
|
||||
|
||||
reload: ->
|
||||
if Issues.created
|
||||
Issues.initChecks()
|
||||
if Issuable.created
|
||||
Issuable.initChecks()
|
||||
|
||||
$('#filter_issue_search').val($('#issue_search').val())
|
||||
|
||||
initChecks: ->
|
||||
$('.check_all_issues').on 'click', ->
|
||||
$('.selected_issue').prop('checked', @checked)
|
||||
Issuable.checkChanged()
|
||||
|
||||
$('.selected_issue').on 'change', Issuable.checkChanged
|
||||
|
||||
updateStateFilters: ->
|
||||
stateFilters = $('.issues-state-filters, .dropdown-menu-sort')
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
@Issues =
|
||||
init: ->
|
||||
Issues.created = true
|
||||
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
|
||||
$(".issues-other-filters").hide()
|
||||
$(".issues_bulk_update").show()
|
||||
else
|
||||
$("#update_issues_ids").val []
|
||||
$(".issues_bulk_update").hide()
|
||||
$(".issues-other-filters").show()
|
|
@ -278,7 +278,7 @@ module ApplicationHelper
|
|||
|
||||
path = request.path
|
||||
|
||||
if params != nil
|
||||
if !params.nil?
|
||||
path << "?#{params.to_param}"
|
||||
if add_label
|
||||
if params[:label_name].present? and params[:label_name].respond_to?('any?')
|
||||
|
|
Loading…
Reference in a new issue