BigW Consortium Gitlab

Commit fdb703d7 by Jacob Schatz

Fix up commit message

parent 3753ace9
...@@ -41,6 +41,7 @@ class @LabelsSelect ...@@ -41,6 +41,7 @@ class @LabelsSelect
'</span>'+ '</span>'+
'</a>'+ '</a>'+
'<% }); %>'); '<% }); %>');
labelNoneHTMLTemplate = _.template('<div class="light">None</div>')
if newLabelField.length and $dropdown.hasClass 'js-extra-options' if newLabelField.length and $dropdown.hasClass 'js-extra-options'
$('.suggest-colors-dropdown a').on "click", (e) -> $('.suggest-colors-dropdown a').on "click", (e) ->
...@@ -176,6 +177,8 @@ class @LabelsSelect ...@@ -176,6 +177,8 @@ class @LabelsSelect
$selectbox.hide() $selectbox.hide()
$value.show() $value.show()
multiSelect: $dropdown.hasClass 'js-multiselect'
clicked: -> clicked: ->
page = $('body').data 'page' page = $('body').data 'page'
isIssueIndex = page is 'projects:issues:index' isIssueIndex = page is 'projects:issues:index'
...@@ -190,11 +193,9 @@ class @LabelsSelect ...@@ -190,11 +193,9 @@ class @LabelsSelect
.closest('.selectbox') .closest('.selectbox')
.find('input[type="hidden"]') .find('input[type="hidden"]')
.val() .val()
console.log 'selected', selected
# need inline-block here instead of show, # need inline-block here instead of show,
# which will default to the element's style in this case inline. # which will default to the element's style in this case inline.
selected = if selected? then [ selected ] else [''] selected = if selected? then selected.split(',') else ['']
console.log 'selected', selected
$loading $loading
.fadeIn() .fadeIn()
$.ajax( $.ajax(
...@@ -206,7 +207,11 @@ class @LabelsSelect ...@@ -206,7 +207,11 @@ class @LabelsSelect
).done (data) -> ).done (data) ->
$loading.fadeOut() $loading.fadeOut()
$selectbox.hide() $selectbox.hide()
if not data.labels.length
template = labelNoneHTMLTemplate()
else
template = labelHTMLTemplate(data)
href = $value href = $value
.show() .show()
.html(labelHTMLTemplate(data)) .html(template)
) )
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