diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-01 11:49:27 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-01 11:49:27 +0300 |
commit | de1c81645c6aa29acc1aceafa123a861f822ee49 (patch) | |
tree | 9bd37f9beda930e594986a0b440ba5762084aa79 /app/assets | |
parent | 2e3c2a355fbb362364c27ecceb1f21ef83aeddbb (diff) | |
parent | cc79eedb8569f70489751e53093d8f3b8d56d9be (diff) |
Merge branch 'filter-dropdown-bug' into 'master'
Fixes issue with dropdowns not selecting values
Fixes issue with dropdowns not selecting when navigating between tabs
Closes #14813
See merge request !3478
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js.coffee | 4 | ||||
-rw-r--r-- | app/assets/javascripts/milestone_select.js.coffee | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee index 0fea2a69cb7..4f032a82e58 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -343,7 +343,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() @@ -373,6 +373,8 @@ class GitLabDropdown input = $(input) .attr('id', @options.inputId) @dropdown.before input + else + field.val value return selectedObject diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee index e2a7d5fbba2..f73127f49f0 100644 --- a/app/assets/javascripts/milestone_select.js.coffee +++ b/app/assets/javascripts/milestone_select.js.coffee @@ -84,12 +84,16 @@ class @MilestoneSelect # display:block overrides the hide-collapse rule $value.removeAttr('style') - clicked: (e) -> + clicked: (selected) -> if $dropdown.hasClass 'js-filter-bulk-update' return - if $dropdown.hasClass 'js-filter-submit' - $dropdown.parents('form').submit() + if $dropdown.hasClass('js-filter-submit') + if selected.name? + selectedMilestone = selected.name + else + selectedMilestone = '' + Issues.filterResults $dropdown.closest('form') else selected = $selectbox .find('input[type="hidden"]') @@ -117,4 +121,4 @@ class @MilestoneSelect else $value.html(milestoneLinkNoneTemplate) $sidebarCollapsedValue.find('span').text('No') - )
\ No newline at end of file + ) |