Commit aa4da384 authored by Jacob Schatz's avatar Jacob Schatz

Make label search work with JSON data

parent a76ee508
......@@ -14,6 +14,7 @@ class @MilestoneSelect
$selectbox = $dropdown.closest('.selectbox')
$block = $selectbox.closest('.block')
$value = $block.find('.value')
$loading = $block.find('.block-loading').fadeOut()
$dropdown.glDropdown(
data: (term, callback) ->
......@@ -67,7 +68,10 @@ class @MilestoneSelect
.closest('.selectbox')
.find('input[type="hidden"]')
.val()
console.log 'gonna ajax it with', url: issueUpdateURL, data: issue: milestone_id: selected
# need inline-block here instead of show,
# which will default to the element's style in this case inline.
$loading
.fadeIn()
$.ajax(
type: 'PUT'
url: issueUpdateURL
......@@ -75,14 +79,15 @@ class @MilestoneSelect
issue:
milestone_id: selected
).done (data) ->
$loading.fadeOut()
$selectbox.hide()
href = $value
.show()
.find('.milestone-title')
.text(data.milestone.title)
.end()
.find('a')
.attr('href')
.show()
.find('.milestone-title')
.text(data.milestone.title)
.end()
.find('a')
.attr('href')
splitHref = href.split('/')
splitHref[splitHref.length - 1] = data.id
$value
......
......@@ -23,7 +23,6 @@
.filter-item.inline.labels-filter
= render "shared/issuable/label_dropdown"
.pull-right
= render 'shared/sort_dropdown'
......
......@@ -54,6 +54,7 @@
No
.title.hide-collapsed
Milestone
=icon('spinner spin', class: 'block-loading')
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right'
.value.bold.hide-collapsed
......
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