 
   constructor: (@element) ->
     @attributes = {}
+    @resetDialogInputs()
 
     handleEvent "mousedown", onElement: @element, matchingSelector: actionButtonSelector, withCallback: @didClickActionButton
     handleEvent "mousedown", onElement: @element, matchingSelector: attributeButtonSelector, withCallback: @didClickAttributeButton


  hideDialog: ->
    @element.querySelector(activeDialogSelector)?.classList.remove("active")
    for input in @element.querySelectorAll("input.validate")
      input.classList.remove("validate")
    @delegate?.toolbarDidHideDialog()

  getDialogForAttributeName: (attributeName) ->
    @element.querySelector(".dialog[data-attribute=#{attributeName}]")


    element = @getDialogForAttributeName(attributeName)
    input = getInputForDialog(element, attributeName)
    @delegate?.toolbarWillShowDialog(input?)
    element.classList.add("active")

    if input
      input.removeAttribute("disabled")
      input.value = @attributes[attributeName] ? ""
      input.select()

  setAttribute: (dialogElement) ->
    attributeName = getAttributeName(dialogElement)
