mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
Merge branch '18536_status_dropdown_label' into 'master'
Set button label when picking an option from status dropdown ## What does this MR do? Fixes an issue with the status dropdown. It was not setting up the correct label after picking an option ## What are the relevant issue numbers? Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/18536 ## Screenshots (if relevant) **Previous**  **After**  ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - [ ] Tests - [ ] Added for this feature/bug - [x] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4771
This commit is contained in:
committed by
Robert Speicher
parent
3f75371956
commit
bb5eec45fc
@@ -462,7 +462,7 @@ class GitLabDropdown
|
||||
|
||||
# Toggle the dropdown label
|
||||
if @options.toggleLabel
|
||||
@updateLabel()
|
||||
@updateLabel(selectedObject, el, @)
|
||||
else
|
||||
selectedObject
|
||||
else if el.hasClass(INDETERMINATE_CLASS)
|
||||
@@ -489,7 +489,7 @@ class GitLabDropdown
|
||||
|
||||
# Toggle the dropdown label
|
||||
if @options.toggleLabel
|
||||
@updateLabel(selectedObject, el)
|
||||
@updateLabel(selectedObject, el, @)
|
||||
if value?
|
||||
if !field.length and fieldName
|
||||
@addInput(fieldName, value)
|
||||
@@ -588,8 +588,8 @@ class GitLabDropdown
|
||||
# Scroll the dropdown content up
|
||||
$dropdownContent.scrollTop(listItemTop - dropdownContentTop)
|
||||
|
||||
updateLabel: (selected = null, el = null) =>
|
||||
$(@el).find(".dropdown-toggle-text").text @options.toggleLabel(selected, el)
|
||||
updateLabel: (selected = null, el = null, instance = null) =>
|
||||
$(@el).find(".dropdown-toggle-text").text @options.toggleLabel(selected, el, instance)
|
||||
|
||||
$.fn.glDropdown = (opts) ->
|
||||
return @.each ->
|
||||
|
||||
@@ -6,6 +6,13 @@ class @IssueStatusSelect
|
||||
$(el).glDropdown(
|
||||
selectable: true
|
||||
fieldName: fieldName
|
||||
toggleLabel: (selected, el, instance) =>
|
||||
label = 'Author'
|
||||
$item = instance.dropdown.find('.is-active')
|
||||
label = $item.text() if $item.length
|
||||
label
|
||||
clicked: (item, $el, e)->
|
||||
e.preventDefault()
|
||||
id: (obj, el) ->
|
||||
$(el).data("id")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user