       menu: "[data-js-menu]"
       button: "[data-js-button]"
 
-    bindings:
-      "@ui.menu": "collection: $collection"
-
     events:
       "click": "onClick"
 
     initialize: ->
+      window.aaa = @
       @collection = new DropDownCollection
-      @listenTo @collection, "change:active", @onChangeCollectionActive
+      @listenTo @collection,
+        "change:active": @onChangeCollectionActive
+        "add": @onAddCollection
+        "remove": @onRemoveCollection
       @currentActiveModel = null
+      @views = {}
 
     bindToInput: (@$input)->
 

define (require, exports, module)->
  Backbone = require "backbone"
  MixinBackbone = require "backbone-mixin"
  require "epoxy"

  View = MixinBackbone Backbone.Epoxy.View


    className: "dropdown_item"
    tagName: "li"

    events:
      "click": "onClick"

    initialize: ->
      @listenTo @model,
        "change:text": @onTextChange
        "change:active": @onActiveChange
      @updateText()
      @updateActive()

    updateText: ->
      @$el.text @model.get "text"

    updateActive: ->
      if @model.get "active"
        @$el.addClass "active"
      else
        @$el.removeClass "active"

    onTextChange: ->
      @updateText()

    onActiveChange: ->
      @updateActive()

    onClick: ->
      @model.set active:true
