Commit 31b1dc3c authored by Phil Hughes's avatar Phil Hughes

Fixed failing rubocop tests

Fixed issue with issuable checkboxs not being init'd
parent 7eb97ef4
...@@ -5,6 +5,7 @@ issuable_created = false ...@@ -5,6 +5,7 @@ issuable_created = false
issuable_created = true issuable_created = true
Issuable.initTemplates() Issuable.initTemplates()
Issuable.initSearch() Issuable.initSearch()
Issuable.initChecks()
initTemplates: -> initTemplates: ->
Issuable.labelRow = _.template( Issuable.labelRow = _.template(
...@@ -62,11 +63,17 @@ issuable_created = false ...@@ -62,11 +63,17 @@ issuable_created = false
dataType: "json" dataType: "json"
reload: -> reload: ->
if Issues.created if Issuable.created
Issues.initChecks() Issuable.initChecks()
$('#filter_issue_search').val($('#issue_search').val()) $('#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: -> updateStateFilters: ->
stateFilters = $('.issues-state-filters, .dropdown-menu-sort') stateFilters = $('.issues-state-filters, .dropdown-menu-sort')
......
@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 ...@@ -278,7 +278,7 @@ module ApplicationHelper
path = request.path path = request.path
if params != nil if !params.nil?
path << "?#{params.to_param}" path << "?#{params.to_param}"
if add_label if add_label
if params[:label_name].present? and params[:label_name].respond_to?('any?') if params[:label_name].present? and params[:label_name].respond_to?('any?')
......
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