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

      menu: "[data-js-menu]"
      button: "[data-js-button]"

    bindings:
      "@ui.menu": "collection: $collection"

    events:
      "click": "onClick"

    initialize: ->
      @collection = new DropDownCollection
      @listenTo @collection, "change:active", @onChangeCollectionActive
      @currentActiveModel = null

    bindToInput: (@$input)->


    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
