Commit ce066ba6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'autocomplete-on-load' into 'master'

Load autocomplete data when loading an issue page



See merge request !2312
parents e9f84c4c cb22e5f9
...@@ -34,7 +34,7 @@ GitLab.GfmAutoComplete = ...@@ -34,7 +34,7 @@ GitLab.GfmAutoComplete =
searchKey: 'search' searchKey: 'search'
callbacks: callbacks:
beforeSave: (members) -> beforeSave: (members) ->
$.map members, (m) -> $.map members, (m) ->
title = m.name title = m.name
title += " (#{m.count})" if m.count title += " (#{m.count})" if m.count
...@@ -50,7 +50,7 @@ GitLab.GfmAutoComplete = ...@@ -50,7 +50,7 @@ GitLab.GfmAutoComplete =
insertTpl: '${atwho-at}${id}' insertTpl: '${atwho-at}${id}'
callbacks: callbacks:
beforeSave: (issues) -> beforeSave: (issues) ->
$.map issues, (i) -> $.map issues, (i) ->
id: i.iid id: i.iid
title: sanitize(i.title) title: sanitize(i.title)
search: "#{i.iid} #{i.title}" search: "#{i.iid} #{i.title}"
...@@ -63,18 +63,17 @@ GitLab.GfmAutoComplete = ...@@ -63,18 +63,17 @@ GitLab.GfmAutoComplete =
insertTpl: '${atwho-at}${id}' insertTpl: '${atwho-at}${id}'
callbacks: callbacks:
beforeSave: (merges) -> beforeSave: (merges) ->
$.map merges, (m) -> $.map merges, (m) ->
id: m.iid id: m.iid
title: sanitize(m.title) title: sanitize(m.title)
search: "#{m.iid} #{m.title}" search: "#{m.iid} #{m.title}"
input.one 'focus', => $.getJSON(@dataSource).done (data) ->
$.getJSON(@dataSource).done (data) -> # load members
# load members input.atwho 'load', '@', data.members
input.atwho 'load', '@', data.members # load issues
# load issues input.atwho 'load', 'issues', data.issues
input.atwho 'load', 'issues', data.issues # load merge requests
# load merge requests input.atwho 'load', 'mergerequests', data.mergerequests
input.atwho 'load', 'mergerequests', data.mergerequests # load emojis
# load emojis input.atwho 'load', ':', data.emojis
input.atwho 'load', ':', data.emojis
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment