[#369] new pull request: fix a 'To project' typehead
This commit is contained in:
parent
3cef7bd250
commit
a1fae2f1b1
|
@ -1,5 +1,6 @@
|
|||
_.each $('input.typeahead'), (item) ->
|
||||
item = $(item)
|
||||
item = $(item)
|
||||
triggerLength = 1
|
||||
|
||||
if item.data('id')
|
||||
onSelect = (i) ->
|
||||
|
@ -8,7 +9,10 @@ _.each $('input.typeahead'), (item) ->
|
|||
if item.attr('id') is 'to_project'
|
||||
onSelect = (data) ->
|
||||
pullUpdateToProject(data)
|
||||
triggerLength = 3
|
||||
|
||||
item.typeahead
|
||||
ajax: item.data('ajax')
|
||||
onSelect: onSelect
|
||||
ajax:
|
||||
url: item.data('ajax')
|
||||
triggerLength: triggerLength
|
||||
onSelect: onSelect
|
||||
|
|
|
@ -103,7 +103,7 @@ class Projects::PullRequestsController < Projects::BaseController
|
|||
|
||||
def autocomplete_to_project
|
||||
items = []
|
||||
term = params[:term].to_s.strip.downcase
|
||||
term = params[:query].to_s.strip.downcase
|
||||
[ Project.where(id: @project.pull_requests.last.try(:to_project_id)),
|
||||
@project.ancestors,
|
||||
Project.accessible_by(current_ability, :membered)
|
||||
|
|
Loading…
Reference in New Issue