From aa4da384357c025ce6e363eebd9182ffb39b7bd4 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Sat, 12 Mar 2016 11:34:26 -0500 Subject: [PATCH] Make label search work with JSON data --- .../javascripts/milestone_select.js.coffee | 19 ++++++++++++------- app/views/shared/issuable/_filter.html.haml | 1 - app/views/shared/issuable/_sidebar.html.haml | 1 + 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