     @[method].call(this, dialogElement)
 
   setAttribute: (dialogElement) ->
-    attributeName = getButtonAttributeName(dialogElement)
+    attributeName = getAttributeName(dialogElement)
     value = getInputForDialog(dialogElement).value
     @delegate?.toolbarDidUpdateAttribute(attributeName, value)
 


  eachButton: (callback) ->
    for element in @element.querySelectorAll(buttonSelector)
      callback(element, getButtonAttributeName(element))

  showDialog: (attributeName) ->
    @delegate?.toolbarWillShowDialog()


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

    if @getDialogForAttributeName(attributeName)
      @showDialog(attributeName)
