Files
gitlabhq/app/assets/javascripts/issue_status_select.js.coffee
T
Jacob SchatzandRobert Speicher bb5eec45fc 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**

![status-select-previous](/uploads/7c6adbd6c5ba2660dc39a762d53d3b68/status-select-previous.gif)

**After**

![status-select](/uploads/91483efed8fbd63a79a01c9ca2154b74/status-select.gif)

## 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
2016-06-23 22:10:07 +00:00

19 lines
524 B
CoffeeScript

class @IssueStatusSelect
constructor: ->
$('.js-issue-status').each (i, el) ->
fieldName = $(el).data("field-name")
$(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")
)