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


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

    if @getDialogForAttributeName(attributeName)
      @showDialog(attributeName)

    @[method].call(this, dialogElement)

  setAttribute: (dialogElement) ->
    attributeName = getAttributeName(dialogElement)
    value = getInputForDialog(dialogElement).value
    @delegate?.toolbarDidUpdateAttribute(attributeName, value)

