   getDialogForAttributeName: (attributeName) ->
     @element.querySelector(".dialog[data-attribute=#{attributeName}]")
 
-  getButtonAttributeName = (element) ->
+  getAttributeName = (element) ->
     element.getAttribute("data-attribute")
 
   getInputForDialog = (element) ->
-    attributeName = getButtonAttributeName(element)
+    attributeName = getAttributeName(element)
     element.querySelector("input[name='#{attributeName}']")

    @[method].call(this, dialogElement)

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



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

    if @getDialogForAttributeName(attributeName)
      @showDialog(attributeName)
