diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-05-26 18:28:01 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-05-26 18:28:01 +0000 |
commit | 1a848d835447fb0b0948dac6751a947643bdeb3a (patch) | |
tree | 80892571397061b3077de88d36f4d0a103f3e63b /app/assets | |
parent | 9bdfc98242f6fa039b73f47e6105faded1027eb1 (diff) | |
parent | 50a16c4bd75307f05bcffa4d1231872a1346ae6e (diff) | |
download | gitlab-ce-1a848d835447fb0b0948dac6751a947643bdeb3a.tar.gz |
Merge branch 'move-project-dropdown-async' into 'master'
Loads move issue dropdown async
To keep the style of the dropdown the same as the other dropdowns in the issue form, it uses select2 rather than our new dropdowns.
![dropdown](/uploads/e80d5f48440b2a49fd3ac13e74c1ba55/dropdown.gif)
Closes #16563
See merge request !4160
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/issuable_form.js.coffee | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/assets/javascripts/issuable_form.js.coffee b/app/assets/javascripts/issuable_form.js.coffee index 72ae3bde81e..898506fde32 100644 --- a/app/assets/javascripts/issuable_form.js.coffee +++ b/app/assets/javascripts/issuable_form.js.coffee @@ -19,6 +19,7 @@ class @IssuableForm @form.on "click", ".btn-cancel", @resetAutosave @initWip() + @initMoveDropdown() $issuableDueDate = $('#issuable-due-date') @@ -89,3 +90,19 @@ class @IssuableForm addWip: -> @titleField.val "WIP: #{@titleField.val()}" + + initMoveDropdown: -> + $moveDropdown = $('.js-move-dropdown') + + if $moveDropdown.length + $('.js-move-dropdown').select2 + ajax: + url: $moveDropdown.data('projects-url') + results: (data) -> + return { + results: data + } + formatResult: (project) -> + project.name_with_namespace + formatSelection: (project) -> + project.name_with_namespace |