diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-29 12:17:22 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-29 12:17:22 +0100 |
commit | 35b3c7096dc8d49000b896fd8ff1eb999e8cc321 (patch) | |
tree | 893c2fb97cd2ae8123b2328c603d2d6b639ac8ec /app | |
parent | f8b5ff95202dec5011d92427d9acbe858b59b57d (diff) | |
download | gitlab-ce-35b3c7096dc8d49000b896fd8ff1eb999e8cc321.tar.gz |
Fixed multiselect
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js.coffee | 10 | ||||
-rw-r--r-- | app/assets/javascripts/milestone_select.js.coffee | 24 |
2 files changed, 6 insertions, 28 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee index b03a95a80e8..dd0465b9358 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -284,6 +284,7 @@ class GitLabDropdown selectedObject = @renderedData[selectedIndex] value = if @options.id then @options.id(selectedObject, el) else selectedObject.id field = @dropdown.parent().find("input[name='#{fieldName}'][value='#{value}']") + if el.hasClass(ACTIVE_CLASS) el.removeClass(ACTIVE_CLASS) field.remove() @@ -292,13 +293,6 @@ class GitLabDropdown if @options.toggleLabel $(@el).find(".dropdown-toggle-text").text @options.toggleLabel else - fieldName = @options.fieldName - selectedIndex = el.parent().index() - if @renderedData - selectedObject = @renderedData[selectedIndex] - selectedObject.selected = true - value = if @options.id then @options.id(selectedObject, el) else selectedObject.id - if !value? field.remove() @@ -321,8 +315,6 @@ class GitLabDropdown .attr('id', @options.inputId) @dropdown.before input - @dropdown.parent().find("input[name='#{fieldName}']").val value - return selectedObject selectFirstRow: -> diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee index f98a7dda3dd..d61d03791fa 100644 --- a/app/assets/javascripts/milestone_select.js.coffee +++ b/app/assets/javascripts/milestone_select.js.coffee @@ -33,20 +33,6 @@ class @MilestoneSelect $.ajax( url: milestonesUrl ).done (data) -> -<<<<<<< c9dea7761dc69ff38d101d06e0e636e1f3b2a0c4 - if $dropdown.hasClass "js-extra-options" - if showNo - data.unshift( - id: '0' - title: 'No Milestone' - ) - - if showAny - data.unshift( - isAny: true - title: 'Any Milestone' - ) -======= extraOptions = [] if showAny extraOptions.push( @@ -68,11 +54,11 @@ class @MilestoneSelect name: '#upcoming' title: 'Upcoming' ) ->>>>>>> Updated to only include upcoming on filters - if data.length > 2 - data.splice 2, 0, 'divider' - callback(data) + if extraOptions.length > 2 + extraOptions.push 'divider' + + callback(extraOptions.concat(data)) filterable: true search: fields: ['title'] @@ -99,7 +85,7 @@ class @MilestoneSelect if $dropdown.hasClass 'js-filter-bulk-update' return - if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex) + if $dropdown.hasClass('js-filter-submit') if selected.name? selectedMilestone = selected.name else if selected.title? |