   enable: ->
     @$el.removeClass("disabled")
     @_text_input_view.enable()
-
-  autoCompleteCurrentValue: ->
-    searchValue = @model.get('text')
-    @search_collection.searchFor searchValue

      collection: @collection
      mainView: this

    @model = new Backbone.Model text: ''
    @model.on 'change', => @autoCompleteCurrentValue()
    @_text_input_view = new TextInputView model: @model

    @search_collection = new TopicSearchResults()
    @filtered_search_collection = collectionDifference(TopicSearchResults,
      'slug_title', @search_collection, @collection)


#= require ./generic/text_input_view
searchCollection = (type)->
  model = new Backbone.Model text: ''
  collection = new type()
  model.on 'change', -> collection.searchFor model.get('text')

  [model, collection]

class window.AutoCompletedAddToChannelView extends Backbone.Marionette.Layout
  tagName: "div"
  className: "add-to-channel"
