diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-31 21:25:08 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-31 22:19:59 +0300 |
commit | cc79eedb8569f70489751e53093d8f3b8d56d9be (patch) | |
tree | 01c498562c92020c265959c4bec2eb640b01f1bd /app/assets | |
parent | 0af8587d88bd03d107438343b7895ad30f7a9308 (diff) |
Fixes issue with dropdowns not selecting values
Fixes issue with dropdowns not selecting when navigating between tabs
Closes #14813
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 dbcad9c0514..e938b9310dc 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -288,7 +288,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() @@ -318,6 +318,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 + ) |