   # Milestones
   Milestones:
     template: '<li>${title}</li>'
+
+  Loading:
+    template: '<li><i class="fa fa-refresh fa-spin"></i> Loading...</li>'
+
+  DefaultOptions:
+    sorter: (query, items, searchKey) ->
+      return items if items[0].name? and items[0].name is 'loading'
+
+      $.fn.atwho.default.callbacks.sorter(query, items, searchKey)
+    filter: (query, data, searchKey) ->
+      return data if data[0] is 'loading'
+
+      $.fn.atwho.default.callbacks.filter(query, data, searchKey)
+    beforeInsert: (value) ->
+      if value.indexOf('undefined')
+        @at
+      else
+        value
 
   # Add GFM auto-completion to all input fields, that accept GFM input.
   setup: (wrap) ->

      at: '#'
      alias: 'issues'
      searchKey: 'search'
      displayTpl: @Issues.template
      insertTpl: '${atwho-at}${id}'
      callbacks:
        beforeSave: (issues) ->
          $.map issues, (i) ->
            id:     i.iid
            title:  sanitize(i.title)
            search: "#{i.iid} #{i.title}"

    @input.atwho 'load', 'mergerequests', data.mergerequests
    # load emojis
    @input.atwho 'load', ':', data.emojis

    # This trigger at.js again
    # otherwise we would be stuck with loading until the user types
    $(':focus').trigger('keyup')
