diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-24 18:20:35 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-29 13:59:13 +0300 |
commit | 88024b17c03f5cc834465574c55a566f8f1a5819 (patch) | |
tree | dd3dc42801c5553103e6a9d6922918266b6377e1 /app/assets/javascripts/milestone_select.js.coffee | |
parent | 3aeda8c94f446931a38f3dcc22b7c835ef5cc818 (diff) |
Standardised the output of the JSON to always include the name
The frontend will then always use the name as the ID - like previous
Diffstat (limited to 'app/assets/javascripts/milestone_select.js.coffee')
-rw-r--r-- | app/assets/javascripts/milestone_select.js.coffee | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee index 10c776a0501..b569b7eb7bf 100644 --- a/app/assets/javascripts/milestone_select.js.coffee +++ b/app/assets/javascripts/milestone_select.js.coffee @@ -50,19 +50,22 @@ class @MilestoneSelect extraOptions = [] if showAny extraOptions.push( - isAny: true + id: 0 + name: '' title: 'Any Milestone' ) if showNo extraOptions.push( - id: '0' + id: -1 + name: 'No Milestone' title: 'No Milestone' ) if showUpcoming extraOptions.push( - id: '#upcoming' + id: -2 + name: '#upcoming' title: 'Upcoming' ) >>>>>>> Updated to only include upcoming on filters @@ -84,14 +87,11 @@ class @MilestoneSelect milestone.title id: (milestone) -> if !useId - if !milestone.isAny? - milestone.title - else - '' + milestone.name else milestone.id isSelected: (milestone) -> - milestone.title is selectedMilestone + milestone.name is selectedMilestone hidden: -> $selectbox.hide() $value.show() @@ -99,8 +99,10 @@ class @MilestoneSelect if $dropdown.hasClass 'js-filter-bulk-update' return - if $dropdown.hasClass 'js-filter-submit' - if selected.title? + if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex) + if selected.name? + selectedMilestone = selected.name + else if selected.title? selectedMilestone = selected.title $dropdown.parents('form').submit() else |