diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-08 08:38:16 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-10 13:54:54 +0000 |
commit | 562a09c1277270a72be580cf04c600e38d0dac06 (patch) | |
tree | 499b65a5e458c6ab15e2720d9a17b6fdc1921037 /app/assets/javascripts/milestone_select.js.coffee | |
parent | d6e5ed8a97b20eff242b394999a71fb828822d50 (diff) | |
download | gitlab-ce-562a09c1277270a72be580cf04c600e38d0dac06.tar.gz |
milestone dropdown
Diffstat (limited to 'app/assets/javascripts/milestone_select.js.coffee')
-rw-r--r-- | app/assets/javascripts/milestone_select.js.coffee | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee new file mode 100644 index 00000000000..184479e209c --- /dev/null +++ b/app/assets/javascripts/milestone_select.js.coffee @@ -0,0 +1,23 @@ +class @MilestoneSelect + constructor: -> + $('.js-milestone-select').each (i, dropdown) -> + projectId = $(dropdown).data('project-id') + selectedMilestone = $(dropdown).data('selected') + + $(dropdown).glDropdown( + data: (callback) -> + Api.milestones projectId, callback + filterable: true + search: + fields: ['name'] + selectable: true + fieldName: $(dropdown).data('field-name') + text: (milestone) -> + milestone.title + id: (milestone) -> + milestone.title + isSelected: (milestone) -> + milestone.title is selectedMilestone + clicked: -> + $(dropdown).parents('form').submit() + ) |