summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-03-12 11:34:26 -0500
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-03-25 08:04:57 -0400
commitaa4da384357c025ce6e363eebd9182ffb39b7bd4 (patch)
treefebc82682b48ad6855eecb45d005ee8d9ec34b73
parenta76ee508fbf203c3708277d1d09e91d5a7b5adfa (diff)
downloadgitlab-ce-aa4da384357c025ce6e363eebd9182ffb39b7bd4.tar.gz
Make label search work with JSON data
-rw-r--r--app/assets/javascripts/milestone_select.js.coffee19
-rw-r--r--app/views/shared/issuable/_filter.html.haml1
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml1
3 files changed, 13 insertions, 8 deletions
diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee
index f67e12f9ad1..680a24a3c04 100644
--- a/app/assets/javascripts/milestone_select.js.coffee
+++ b/app/assets/javascripts/milestone_select.js.coffee
@@ -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
diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml
index f91ff0e3694..a7840f1b393 100644
--- a/app/views/shared/issuable/_filter.html.haml
+++ b/app/views/shared/issuable/_filter.html.haml
@@ -23,7 +23,6 @@
.filter-item.inline.labels-filter
= render "shared/issuable/label_dropdown"
-
.pull-right
= render 'shared/sort_dropdown'
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 0a8300cc513..d44ab935831 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -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