diff options
Diffstat (limited to 'app/assets/javascripts/milestone_select.js.coffee')
-rw-r--r-- | app/assets/javascripts/milestone_select.js.coffee | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee index d61d03791fa..f73127f49f0 100644 --- a/app/assets/javascripts/milestone_select.js.coffee +++ b/app/assets/javascripts/milestone_select.js.coffee @@ -18,6 +18,7 @@ class @MilestoneSelect abilityName = $dropdown.data('ability-name') $selectbox = $dropdown.closest('.selectbox') $block = $selectbox.closest('.block') + $sidebarCollapsedValue = $block.find('.sidebar-collapsed-icon') $value = $block.find('.value') $loading = $block.find('.block-loading').fadeOut() @@ -80,7 +81,9 @@ class @MilestoneSelect milestone.name is selectedMilestone hidden: -> $selectbox.hide() - $value.show() + + # display:block overrides the hide-collapse rule + $value.removeAttr('style') clicked: (selected) -> if $dropdown.hasClass 'js-filter-bulk-update' return @@ -88,11 +91,9 @@ class @MilestoneSelect if $dropdown.hasClass('js-filter-submit') if selected.name? selectedMilestone = selected.name - else if selected.title? - selectedMilestone = selected.title else selectedMilestone = '' - $dropdown.parents('form').submit() + Issues.filterResults $dropdown.closest('form') else selected = $selectbox .find('input[type="hidden"]') @@ -102,20 +103,22 @@ class @MilestoneSelect data[abilityName].milestone_id = selected $loading .fadeIn() + $dropdown.trigger('loading.gl.dropdown') $.ajax( type: 'PUT' url: issueUpdateURL data: data ).done (data) -> + $dropdown.trigger('loaded.gl.dropdown') $loading.fadeOut() $selectbox.hide() - $milestoneLink = $value - .show() - .find('a') + $value.removeAttr('style') if data.milestone? data.milestone.namespace = _this.currentProject.namespace data.milestone.path = _this.currentProject.path $value.html(milestoneLinkTemplate(data.milestone)) + $sidebarCollapsedValue.find('span').text(data.milestone.title) else $value.html(milestoneLinkNoneTemplate) + $sidebarCollapsedValue.find('span').text('No') ) |