Commit 19b9df2d authored by Jacob Schatz's avatar Jacob Schatz

storing multiple values for comma seperation

parent dfadbe5e
...@@ -49,16 +49,14 @@ ...@@ -49,16 +49,14 @@
Issues.filterResults $("#issue_search_form") Issues.filterResults $("#issue_search_form")
, 500) , 500)
filterResults: (form) => filterResults: (form, inputs) =>
console.log('form', form)
$('.issues-holder, .merge-requests-holder').css("opacity", '0.5') $('.issues-holder, .merge-requests-holder').css("opacity", '0.5')
formAction = form.attr('action') formAction = form.attr('action')
console.log form.find("input[type='hidden'][name='label_names[]']")
formData = form.serialize() formData = form.serialize()
console.log 'formData', formData
issuesUrl = formAction issuesUrl = formAction
issuesUrl += ("#{if formAction.indexOf("?") < 0 then '?' else '&'}") issuesUrl += ("#{if formAction.indexOf("?") < 0 then '?' else '&'}")
issuesUrl += formData issuesUrl += formData
$.ajax $.ajax
type: "GET" type: "GET"
url: formAction url: formAction
......
...@@ -243,7 +243,10 @@ class @LabelsSelect ...@@ -243,7 +243,10 @@ class @LabelsSelect
$value.removeAttr('style') $value.removeAttr('style')
if $dropdown.hasClass 'js-multiselect' if $dropdown.hasClass 'js-multiselect'
if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex) if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex)
Issues.filterResults $dropdown.closest('form') selectedLabels = $dropdown
.closest('form')
.find("input[type='hidden'][name='#{$dropdown.data('field-name')}']")
Issues.filterResults $dropdown.closest('form'), selectedLabels
else if $dropdown.hasClass('js-filter-submit') else if $dropdown.hasClass('js-filter-submit')
$dropdown.closest('form').submit() $dropdown.closest('form').submit()
else else
...@@ -254,15 +257,18 @@ class @LabelsSelect ...@@ -254,15 +257,18 @@ class @LabelsSelect
page = $('body').data 'page' page = $('body').data 'page'
isIssueIndex = page is 'projects:issues:index' isIssueIndex = page is 'projects:issues:index'
isMRIndex = page is page is 'projects:merge_requests:index' isMRIndex = page is page is 'projects:merge_requests:index'
console.log 'clicked'
if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex) if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex)
selectedLabel = label.title if not $dropdown.hasClass 'js-multiselect'
selectedLabel = label.title
Issues.filterResults $dropdown.closest('form') Issues.filterResults $dropdown.closest('form')
else if $dropdown.hasClass 'js-filter-submit' else if $dropdown.hasClass 'js-filter-submit'
console.log 'clicked else if'
$dropdown.closest('form').submit() $dropdown.closest('form').submit()
else else
console.log 'clicked else'
if $dropdown.hasClass 'js-multiselect' if $dropdown.hasClass 'js-multiselect'
console.log 'clicked else --> if'
return return
else else
saveLabelData() saveLabelData()
......
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