 extend = require "extend"
 Widget = require "./widget"
 Thing = require "../util/thing"
+$ = require "../util/dfdom"
 
 
 ###*

  ###
  init: ->
    unless @initialized
      @element.on "input", (=> @__scheduleUpdate())

      unless (@element.get 0).tagName.toUpperCase() is "TEXTAREA"
        @element.on "keydown", (e) =>
          if e.keyCode? and e.keyCode is 13
            @__scheduleUpdate 0, true
            @trigger "df:input:submit", [@value]

      super


    if not Thing.is.array controller
      controller = [controller]
    @controller = @controller.concat controller

  setElement: (elements) ->
    @element = $ elements

  ###*
   * Initializes the object with a controller and attachs event handlers for
