 
   eachButton: (callback) ->
     for element in @element.querySelectorAll(buttonSelector)
-      callback(element, getButtonAttributeName(element))
+      callback(element, getAttributeName(element))
 
   showDialog: (attributeName) ->
     @delegate?.toolbarWillShowDialog()

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

  getButtonAttributeName = (element) ->
    element.getAttribute("data-attribute")

  getInputForDialog = (element) ->
    attributeName = getButtonAttributeName(element)
    element.querySelector("input[name='#{attributeName}']")


  didClickButton: (event, element) =>
    event.preventDefault()
    attributeName = getAttributeName(element)

    if @getDialogForAttributeName(attributeName)
      @showDialog(attributeName)
